Bala
Answered On : Aug 25th, 2012
Code
SELECT salary FROM
(SELECT salary, dense_rank() over (ORDER BY salary)
FROM emp)
WHERE dense_rank = 7;
Login to rate this answer.
gowtham
Answered On : Oct 1st, 2012
select salary data only
Login to rate this answer.
Amninder
Answered On : Apr 15th, 2013
Select emp_id,emp_name,salary from employee a,
(Select salary,dense_Rank() over (order by salary DESC) rank_sal from employee)b
where a.salary=b.salary
and rank_sal=7;
The Inline Query will order salary by descending order and will correspondingly rank them, and by joining the salary present at 7th number with the main table, we can find the required data.
Login to rate this answer.