I\'m trying to do something like :
SELECT * FROM table LIMIT 10,20
or
SELECT * FROM table LIMIT 10 OFFSET 10
Unfortunately, the ROW_NUMBER()
is the best you can do. It's actually more correct, because the results of a limit
or top
clause don't really have meaning without respect to some specific order. But it's still a pain to do.
Update: Sql Server 2012 adds a limit
-like feature via OFFSET and FETCH keywords. This is the ansi-standard approach, as opposed to LIMIT
, which is a non-standard MySql extension.