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 / saikrishna reddy .k

To find second highest salary
select max(sal) from emp where sal not in (select max(sal)
from emp)

to find order
select top 5 8 from emp order by sal desc

Is This Answer Correct ?    30 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which joins are sql server default?

503


What are the different types of locks in the database?

486


Where are sql server user names and passwords stored in sql server?

525


code to create procedure for taking databse backup in sql server or i have the query for it but what it's query returns means i want to show on my jsp that the databse backup has been taken on the basis of that return value.does it returns 0 or 1.wat is the code for that

1752


Do you know what is sql service broker?

530






What are system databases in ms sql server?

533


What is replication and database mirroring?

572


How can sql injection be stopped? : sql server security

544


What is clustered index

566


How many replicas are maintained for each sql azure db?

104


What is the difference between coalesce() & isnull()?

530


What is the current pricing model of SQL Azure?

88


What is difference between index seek vs. Index scan?

616


How to create a local temporary stored procedure?

497


what is database replication? : Sql server database administration

528