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
what are rollup and cube in t-sql? : Transact sql
how to select first 5 records from a table? : Sql dba
Which is better join or inner query?
how to decrement dates by 1 in mysql? : Sql dba
Can a key be both primary and foreign?
What is sql key?
How do you declare a variable in pl sql?
How is a PL/SQL code compiled?
what is a materialized view? : Sql dba
what is a trigger in mysql? : Sql dba
What are the two virtual tables available at the time of database trigger execution?
Is drop table faster than truncate?
What is union and union all keyword in sql?
Can function return multiple values in sql?
What are the two types of cursors in pl sql?