Posted By

BenJD on 06/29/11


Tagged

mssql


Versions (?)

Paginating Data


 / Published in: SQL
 

  1. WITH [generated-TABLE] AS
  2. (
  3. SELECT ROW_NUMBER() OVER
  4. (
  5. ORDER BY [exampleField] DESC
  6. )
  7. AS ROWID, * FROM [table-name]
  8. )
  9. SELECT * FROM [generated-TABLE]
  10. WHERE ROWID BETWEEN 1 AND 2

Report this snippet  

You need to login to post a comment.