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
Explain what are various ways to enhance the ssrs report?
What is difference between Datepart() and Datename() in SqlServer?
When I run the sql server 2000 setup, it just hangs. What do I do?
How many joins in sql server?
What are cursors? Explain the different types of cursors Enlist a few disadvantages of cursors.
What is nonclustered index with included columns ?
Explain the concepts and capabilities of sql server?
What is an indexed view?
What is correlated subquery in sql server?
What are the system database in sql server 2005?
How do I run sql server 2014?
What the difference between UNION and UNIONALL?
Explain the steps needed to create a scheduled job?
What are Row versions of DataRow?
What are scheduled tasks in sql server?