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 select bottom 10 * from mytable however this does not exist (afaik).
I want the last 10 rows inserted.
There is no timestamp.
You can’t.
There is no guarantee at all that the last 10 records returned by
select * from mytablewill be the last 10 inserted. There is no default ordering that is used.You need an
ORDER BYon an appropriate column reflecting insert order.