Skip to content

Instantly share code, notes, and snippets.

@AlexArchive
Created February 5, 2015 15:58
Show Gist options
  • Save AlexArchive/be7e2904334a0243952a to your computer and use it in GitHub Desktop.
Save AlexArchive/be7e2904334a0243952a to your computer and use it in GitHub Desktop.
USE COMPANY;
SELECT * FROM
(SELECT
*,
ROW_NUMBER() OVER (ORDER BY AnnouncementDate) AS [Index]
FROM dbo.Announcements) AS AnnouncementsWithIndex
WHERE [Index] BETWEEN 1 AND 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment