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
Write the SQL query to drop, truncate and delete table.
What is normalization according to you and explain its different levels?
What is unpivot?
What are system databases into sql server (2005/2008)?
What are the differences between INNER JOIN, LEFT JOIN and RIGHT JOIN in SQL Server?
What is the difference between SQL notification and SQL invalidation?
Define self join?
What are indexers?
Explain about system stored procedure?
What is the purpose of the tempdb database?
What are the types of dml?
What is 2nf normalization?
What types of replication are supported in sql server?
Explain active/passive and active/active cluster configurations?
how to trace the traffic hitting a sql server? : Sql server database administration