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 / veerdhawal

mysql> select max(sal) from emp where sal not in (select
max(sal) from emp);
+----------+
| max(sal) |
+----------+
| 30000 |
+----------+
1 row in set (0.01 sec)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Will sql server 2005 allow you to reduce the size of a column?

559


What is the use of tempdb? What values does it hold?

573


What is side by side migration in sql server?

548


What do you understand by mirroring?

576


What is the difference between varchar and nvarchar?

528






What do you know about system database? : SQL Server Architecture

501


Explain what is raid and what are different types of raid levels?

539


Explain primary key and foreign key constraints?

527


What are sparse columns?

588


Can two tables share a primary key?

528


Can we use custom code in ssrs?

597


Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?

530


What is a self join in sql server?

606


What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?

612


How can we get count of the number of records in a table?

552