how to find the second highest salary from emp table?

Answer Posted / nitin umale

SELECT *
FROM employees
WHERE salary =
( SELECT MIN ( r.salary)
FROM ( SELECT salary
FROM ( SELECT DISTINCT salary
FROM employees
ORDER BY NVL(salary,0) DESC
)
WHERE rownum<3) r
);

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If a cursor is open, how can we find in a pl/sql block?

690


How to Declare Fixed Length String Value In PL SQL

675


What is difference between nchar and nvarchar?

554


What is the difference between stored procedure and view?

541


What is normalization? How many normalization forms are there?

564






what is the command used to fetch first 5 characters of the string? : Sql dba

1151


Can we use two order by clause in query?

557


What is sql entity?

538


what is user defined functions? : Sql dba

557


what is the syntax used for partition in tsql? : Transact sql

553


What action do you have to perform before retrieving data from the next result set of a stored procedure ?

2104


What is sharding in sql?

572


How do you modify a column in sql?

544


What is package in pl sql with an examples?

555


How do I edit a trigger in sql developer?

549