The thing with the ROW_NUMBER function—and window functions in general—is that they are only allowed in the SELECT and ORDER BY clauses of a query.
- 4. Combining Sets
- from Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012
- Publisher: Microsoft Press
- Released: December 2012
Thus the need for a derived table on which a filter predicate can be based.
Share this highlighthttp://www.safaribooksonline.com/a/training-kit-exam/24112/