SQL Server, equivalent to the MySQL / PostgreSQL LIMIT syntax, is TOP (SQL Server 2000+), but TOP does not support the offset value ...
Assuming SQL Server 2005+ uses:
SELECT x.*
FROM (SELECT t.*,
ROW_NUMBER() OVER (ORDER BY ?) AS rank
FROM BLAH t) x
WHERE x.rank BETWEEN 6 AND 20
Remember that you need to determine the sort order for ranking - replace "?" with the corresponding column (s).
source
share