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
What are the properties of primary key?
What is database white box testing?
What is sql injection? How to protect against sql injection attack?
State the difference between union and union all?
What are the built in functions in sql server?
What are the advantages of using stored procedures in sql server?
what is a join and explain different types of joins? : Sql server database administration
What is microsoft sql server?
What is inner join in sql server joins?
Why and when do stored procedure recompile?
How to install sql server 2005 express edition?
How many triggers you can have on a table?
Describe the left outer join & right outer join. : sql server database administration
How to set database to be single_user in ms sql server?
What is raiseerror? What is raiseerror?