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 / pankaj arya
select top 1 sal from emp where empid in(select top 2 empid
from emp order by sal desc) order by
sal asc
if you want to get 3rd one than put 'top 3' in subquery and
same for 4th, 5th....
Is This Answer Correct ? | 15 Yes | 14 No |
Post New Answer View All Answers
why would you use sql agent? : Sql server database administration
What is resultset concur_updatable?
How would you add a section to a table?
Can a trigger be created on a view?
How does using a separate hard drive for several database objects improves performance right away?
What is the meaning of resultset type_scroll_insensitive?
Define inner join? Explain with an example?
Why is sql server log file full?
What are the tables in sql?
What is the cartesian product of the table?
What is identity?
What does man by sql wildcard characters in sql server?
How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?
What are the differences between stored procedure and view in sql server?
What are the five major components of a dbms?