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
what are the critical issues you have resloved in your company
How can you know if the row fetched from cursor is still valid in underlying table?
you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration
How can we determine what objects a user-defined function depends upon?
Explain triggers?
What are extended events in sql server?
What is a trigger and types of a trigger?
Is ssrs support other database except ms sql server?
What is tempdb in sql server?
What is sql collation?
Can another user execute your local temporary stored procedures?
How to get the definition of a user defined function back?
How many types of triggers in sql server?
List some major differences between triggers and stored procedures?
What is the difference between drop table and truncate table?