Created
August 23, 2012 20:27
-
-
Save kennyp/3441263 to your computer and use it in GitHub Desktop.
Because there is not a decent limit clause in MSSQL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
* | |
FROM ( | |
SELECT | |
ROW_NUMBER() OVER (ORDER BY last_name asc) AS RowNum, | |
phppos_people.*, | |
phppos_employees.username, | |
phppos_employees.deleted | |
FROM phppos_people | |
JOIN phppos_employees ON | |
phppos_people.person_id = phppos_employees.person_id | |
WHERE | |
deleted = 0 | |
) AS MyEmployees | |
WHERE MyEmployees.RowNum BETWEEN 0 AND 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment