How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database

plz mail the answer @ mak2786@gmail.com

Answer Posted / subhranghshu bhattacharjee

another way u can find 2nd largest salary,3rd largest
salary ... so on

select sal from(select sal from emp order by sal desc)
where rownum<3
minus
select sal from(select sal from emp order by sal desc)
where rownum<2

only change rownum to find various largest salary

Subhranghshu Bhattacharjee

Is This Answer Correct ?    4 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are connections to sql server encrypted?

582


Why use stored procedures in sql server?

559


Do you know what are the reporting services components?

539


Can I disable or restrict ssrs export formats (rendering formats)?

108


What language is sql server written in?

534






List few advantages of stored procedure.

544


Which rendering formats are affected by the pagesize properties?

106


Explain having clause?

536


Differentiate between a local and a global temporary table?

549


List the different types of collation sensitivities in sql server?

539


How do you manipulate data?

501


What is a periodical index?

510


What is t-sql script to take database offline – take database online.

606


What is trigger explain with program?

540


Explain difference between cross join and full outer join?

568