I have this query:
select top 5 * from tbl_post ORDER BY Id DESC
I want to select the first 5 rows after the 20th row. How I can do this?
Use OFFSET and FETCH MSDN OFFSET FETCH Clause:
SELECT * FROM tbl_post ORDER BY whatever OFFSET 20 ROWS FETCH NEXT 5 ROWS ONLY;
Note that you have to order by something for this to work, and you cannot use top
at the same time
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments