Salary
Salary
//Seleted 2nd heighest salary
select * from Employee_Test e
inner join (select Emp_Sal, row_number() over (order by Emp_Sal desc)
as Rowno from Employee_Test)T on
T.Emp_Sal=e.Emp_Sal
where T.Rowno=2
select Top 1 Emp_Sal from
(select distinct Top 2 Emp_Sal from Employee_Test order by Emp_Sal desc)a
order by Emp_Sal
select max(Emp_Sal) from Employee_Test where Emp_Sal NOT IN (select max(Emp_Sal) from Employee_Test)
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home