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
Describe how to use the linked server?
what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration
What are the types of joins in sql?
Explain trigger and its types?
Where sql server user names and passwords are stored in sql server? : sql server database administration
What is the difference between sdf and mdf?
What are sub reports?
tell me what are the steps you will take to improve performance of a poor performing query? : Sql server database administration
What is sql server profiler?
Does union all remove duplicates?
What is a trigger and its types?
What does it mean to invest in the index?
What the different components in replication and what is their use?
What is lookup override?
What are synonyms?