I hope you can help me with my homework :)
We need to build a query that outputs the top N best paid employees.
My version works perfectly fine.
For exam
The reason you must wrap the statement with another select is because the outer select statement is the one that limits your result set to the row numbers desired. Here's a helpful link on analytics. If you run the inner select by itself you'll see why you have to do this. Analytics are applied AFTER the where clause is evaluated, which is why you get the error that myorder is an invalid identifier.