Working same
Abhishek, August 08, 2016 - 11:43 am UTC
Thans for the response but it actually results in duplicate ranks for same salary. I tried below:
SELECT *
FROM (SELECT id,
salary,
dept,
DENSE_RANK () OVER (PARTITION BY dept ORDER BY salary DESC)
AS dr
FROM sal_test)
WHERE dr <= 5
ORDER BY dept, salary DESC
However, I want to have same salary and rank in single row and not in different rows.
How shall I go for that.
August 08, 2016 - 4:52 pm UTC
What is the output you expect? Give us some sample data along with what you should see when running the query!
Chris