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

Answer Posted / gautam poonia

SELECT sal
FROM (SELECT sal FROM emp
ORDER BY sal desc)
WHERE RowNum<=2
minus
SELECT sal
FROM (SELECT sal FROM emp
ORDER BY sal desc)
WHERE RowNum<=1

Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How much does a sql dba make? : SQL DBA

522


What is sql analyzer?

552


What is a data definition language?

564


How do you bind variables in pl sql?

588


Is there a 64 bit version of ssms?

527






How to test for null values?

615


Explain the uses of database trigger.

666


What is the purpose of the sql select top clause?

561


What is difference between mysql and postgresql?

526


Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

673


What is the file extension for sql database?

525


How do you determine the current isolation level? : Transact sql

586


What are the features of pl sql?

575


Does mysql support pl sql?

636


What is varchar data type in sql?

527