Write a query to find second highest salary of an employee.

Answer Posted / deepshikha

SELECT MAX (sal)
FROM emp a,
(SELECT MAX (sal) max_sal
FROM emp) abc
WHERE a.sal < abc.max_sal
ORDER BY sal DESC;

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

define sql insert statement ? : Sql dba

552


Which one is better subquery or joins?

557


Is sql harder than python?

612


How do I count rows in sql query?

491


How do I remove sql developer from windows 10?

511






What are the different dml commands in sql?

586


What is difference sql and mysql?

535


The in operator may be used if you know the exact value you want to return for at least one of the columns.

558


what is the difference between inner and outer join? Explain with example. : Sql dba

549


What do you understand by pl/sql packages?

573


Is left join faster than join?

549


What are the benefits of stored procedures?

535


in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.

1646


what is query cache in mysql? : Sql dba

577


what is top in tsql? : Transact sql

547