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

Explain Reporting Life Cycle?

102


What is sql server agent and what are the two modes of authentication in sql server?

748


What happens if the update subquery returns no rows in ms sql server?

808


Explain the use of containers in ssis?

688


What is the Difference Between Primary and Foreign Key?

765


What is partition index in sql server?

810


What are the different sql server versions?

696


What is the distinction amongst delete and truncate?

759


What options are there to delete rows on the publisher and not on the subscriber? : sql server replication

905


Which rendering formats are affected by the pagesize properties?

122


What is index, cluster index and nonclustered index?

696


What is @@error in sql?

810


How to end a stored procedure properly in ms sql server?

760


your distribution database is full what will u do

1881


If user is owning any SQL Objects, can we drop that user

1821