Created
February 7, 2019 14:54
-
-
Save seantunwin/c3bb6ba113b2f7ae61a33ebc3da23ef0 to your computer and use it in GitHub Desktop.
MSSQL: Get Range of Rows
This file contains hidden or 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 | |
| ROW_NUMBER() OVER (ORDER BY @id) AS num | |
| [, columns] | |
| FROM @table | |
| WHERE | |
| @id BETWEEN @start AND @end | |
| ORDER BY @id | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment