I want to retrieve the bottom 10 results from a sql server table. I want them to be the last 10 records that were inserted, how can I do this ?
I want to write
https://stackoverflow.com/a/10636585/2858777
with bottom as( select top 4 * from tbl order by n desc ) select * from bottom order by n
Data source:
| N | |----| | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 | | 8 | | 9 | | 10 |
Output:
| N | |----| | 7 | | 8 | | 9 | | 10 |