Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT * FROM (SELECT [EmployeeID], [FirstName], [LastName], [Salary],
- DENSE_RANK() OVER (PARTITION BY [Salary] ORDER BY [EmployeeID]) AS [Rank]
- FROM [Employees]
- WHERE [Salary] BETWEEN 10000 AND 50000 ) AS [query]
- WHERE [query].[Rank] = 2
- ORDER BY [Salary] DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement