Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kgundula/8579904 to your computer and use it in GitHub Desktop.
Save kgundula/8579904 to your computer and use it in GitHub Desktop.
MSSQL equivalent MySQL query with limit clause
SELECT * FROM
(
SELECT TOP 30 *, ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS rnum
FROM table1
) a
WHERE rnum > 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment