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

Write an sql query for deleting duplicate rows?

554


What is abstracting periodical?

529


What is a View ? Can we insert, Update and delete a view?

631


What is best institute to Learn DotNET And SQL in chennai?

1693


What do you understand by intent locks?

577






Explain mixed authentication mode of sql server?

548


What is the need for group functions in sql?

567


What is full outer join in sql server joins?

571


What are the common performance issues in sql server?

505


Name the different type of indexes in sql?

534


What is the syntax to execute the sys.dm_db_missing_index_details?

588


What is t-sql script to take database offline – take database online.

604


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

564


What do you understand by coalesce in sql server?

501


explain different types of constraints? : Sql server database administration

518