Quantcast
Viewing all articles
Browse latest Browse all 24

Answer by Dzamo Norton for SQL Server SELECT LAST N Rows

Here's something you can try without an order by but I think it requires that each row is unique. N is the number of rows you want, L is the number of rows in the table.

select * from tbl_name except select top L-N * from tbl_name

As noted before, which rows are returned is undefined.

EDIT: this is actually dog slow. Of no value really.


Viewing all articles
Browse latest Browse all 24

Trending Articles