create table #ime(num varchar(20),name varchar(20),sal int);
insert into #ime values('1','kannan',10000);
insert into #ime values('2','dinesh',2000);
insert into #ime values('3','dinesh1',3000);
for the above table using that following query i got that column name kk was not found
select name, dense_Rank() over(order by sal)as kk from #ime where kk=2
any buddy help me to identify the second salary from that table without sub-query
kannan gPosted May 23, 2014, 8:35 AM
Bhabani PrasadPosted May 23, 2014, 8:08 AM
Jignesh TrivediPosted May 23, 2014, 7:57 AM
Please refer my article
http://www.c-sharpcorner.com/UploadFile/ff2f08/find-nth-highest-value-in-sql-server/
hope this will help you.
Keyur PatelPosted May 23, 2014, 7:49 AM