LIMIT in T-SQL
March 10th, 2009 by Elchie
The limit-keyword within select-statements is in T-SQL/MS-SQL not available. In MySQL you can retrieve records 5 to 10 with this statement:
select * from tbl limit 5,5
In T-SQL you have to use a temporary table:
with temp as (select *,ROW_NUMBER() OVER (ORDER BY id) as rownum from tbl)
select * from temp where rownum between 5 and 10
Posted in Uncategorized