Skip to content

Instantly share code, notes, and snippets.

@gsampath127
Created October 11, 2019 18:07
Show Gist options
  • Save gsampath127/5ba93bdfd6ad85ce4466576d20f24812 to your computer and use it in GitHub Desktop.
Save gsampath127/5ba93bdfd6ad85ce4466576d20f24812 to your computer and use it in GitHub Desktop.
WITH Result as(
SELECT *, DENSE_RANK() OVER(ORDER BY Salary DESC) AS drank FROM [dbo].[Employees]
)
SELECT * FROM Result WHERE drank = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment