Showing posts with label analytical functions. Show all posts
Showing posts with label analytical functions. Show all posts

Tuesday, May 24, 2022

Query to find the third highest salary


We can used dens_rank() function to find the rank of salaries of employees and then put in a subquery to get rank is equal to 3.  


select * from( select ename, sal, dense_rank() over(order by sal desc)r from Employee) where r=3;



Query to find the third highest salary

We can used dens_rank() function to find the rank of salaries of employees and then put in a subquery to get rank is equal to 3.   select * ...