find out the second highest salary?

Answer Posted / thananjayan

SELECT * FROM 'emp` WHERE salary < ( SELECT max( salary
)FROM emp ) ORDER BY salary DESC LIMIT 1

This is Mysql syntax, if you use Oracle just remove LIMIT 1
and put it ROWNUM=1;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give the constructs of a package, function or a procedure.

541


What happens in oracle commit?

568


Explain the features of oracle?

596


Will you be able to store pictures in the database?

642


How to create a new table in your schema?

605






How to use "if" statements on multiple conditions?

721


How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?

1805


What language does oracle use?

598


Explain index?

747


how to do daily transactions with out sql* loader control file regesterd in apps?

1221


How to invoke the data pump import utility?

651


What are the restrictions on external table columns?

550


Can any one explain me when i execute below query.. select months_between('07-JUL-12','10-FEB-12') from dual; Out put:- 4.90322581 How oracle calculate?

934


How to invoke the data pump export utility?

561


What is not equal to in oracle?

526