Thursday, January 15, 2015

The ORDER BY clause is invalid in views, inline functions, derived tables, and subqueries, unless TOP is also specified.

The ORDER BY clause is invalid in views, inline functions, derived tables, and subqueries, unless TOP is also specified.

This statement tells Order by cannot be the part of view defination unless it is specified with TOP operator.

If you are specifying TOP 100 or TOP 200 or TOP N then only you can specify Ordery By after where clause


Below is the way to write the correct Syntax...

select TOP Col1,Col2

From

Table

Order by COL1

No comments:

Post a Comment