SQL Server Query Error -ORDER BY clause is invalid in views
问题 I am running the below code. When I run this code, I get error message: The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified. I'm not sure why I am getting this error message. Help is much appreciated. SELECT a.DELINQ_BUCKET_GROUP, a.vv_count FROM ( SELECT DELINQ_BUCKET_GROUP, CASE WHEN DELINQ_BUCKET_GROUP IS NULL THEN SUM(CASE WHEN DELINQ_BUCKET_GROUP IS NULL THEN 1 ELSE 0 END) ELSE COUNT