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

What is the difference between the export /import functions in sql studio and standalone sql manager? : sql server management studio

585


How you can add messages to the nt event log from within a stored procedure?

563


What are data files?

577


Tell me what is the order in which the sql query is executed?

526


What are the difference between data mart and data warehouse? : sql server analysis services, ssas

498






define and explain the differences between clustered and non-clustered indexes.

595


What is the default port for SQL Server over a firewall?

587


What is the purpose of the master database?

602


How many databases Microsoft SQL server provides?

607


List the advantages of using stored procedures?

556


What stored by the model?

546


Once setting replication, is it potential to own a publisher as sixty four bit sql server and distributor or subscribers as a thirty two bit sql server?

543


What is the default schema of your login session in ms sql server?

586


Define cursor locking

548


What are the types of sql server?

517