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 / g
TO FIND THE 3rd,
select max(sal) from emptable where salary not in(select
distinct top 2 sal from emptable)
TO FIND THE 4th,
select max(sal) from emptable where salary not in(select
distinct top 3 sal from emptable)
TO FIND THE 5th,
select max(sal) from emptable where salary not in(select
distinct top 4 sal from emptable)
keep change top value...
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How to see existing views in ms sql server?
What are system databases into sql server (2005/2008)?
Can you explain what are various ways to enhance the ssrs report?
Explain boyce and codd normal form(bcnf)?
What is executereader?
What is report subscription?
what is a check constraint?
What are transactions in sql?
What is a non clustered primary key?
Tell me what is the stuff and how does it differ from the replace function?
How to enable/disable indexes?
What is the use of @@spid?
What is save transaction and save point?
What is the command used to check locks in microsoft sql server?
do you know what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration