Dear Sir/Madam....
I want to get third maximum salary....
For that the given below query is working...
If we have more than one same salary(45000) means it will display last inserted value only.... I need to display all the 3rd maximum salary
CREATE TABLE Employee([Eid] [int] NULL,[Ename] [nvarchar](255) NULL,[Basic_Sal] [float] NULL)
insert into Employee values(1,'Neeraj',45000)
insert into Employee values(2,'Ankit',5000)
insert into Employee values(3,'Akshay',6000)
insert into Employee values(4,'Ramesh',7600)
insert into Employee values(5,'Vikas',4000)
insert into Employee values(7,'Neha',8500)
insert into Employee values(8,'Shivika',4500)
insert into Employee values(9,'Tarun',9500)
insert into Employee values(10,'meera',45000)
insert into Employee values(11,'kajal',45000)
insert into Employee values(12,'hansika',45000)
select Ename,Basic_sal
from(select Ename,Basic_Sal,ROW_NUMBER() over (order by Basic_Sal desc) as rowid from Employee)A
where rowid=3
Thanks in Advance