Skip to content Skip to sidebar Skip to footer

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

Solution 1:

If you are using SQL Server 2012 or later version, use Offset 0 Rows after Order By:

SELECT Id,
       Name       
FROMTableORDERBY Id 
OFFSET0ROWS

Hope this helps.

Post a Comment for "Sql Server Query Error -order By Clause Is Invalid In Views"