Click here to Skip to main content
15,905,867 members

Comments by Dhruvin Bhatt (Top 1 by date)

Dhruvin Bhatt 20-Jun-14 9:37am View    
with result as
(
select dense_rank() over(order by salary desc) as 'SecondMaximum',* from emp
)

select Top 2 * from result where SecondMaximum=2 order by id asc;