I want to reverse the order in SQL Server of results after using desc. For example:
SELECT TOP 3 * FROM table ORDER BY id DESC
returns results:
505
504
503
But then I want to flip the results to look like this:
503
504
505
I tried
SELECT * FROM (SELECT TOP 3 * FROM table ORDER BY id DESC) ORDER BY id ASC
But that did not work. How can I fix it?
That should work as long as you alias the subquery.