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

What is the difference between an inner join and an outer join?

720


What is java sql connection?

694


What is java sql drivermanager?

746


What is sql trigger example?

753


What is pivot in sql?

670






What is range partitioning?

695


difference between anonymous blocks and sub-programs.

818


Is there a pl/sql pragma similar to deterministic, but for the scope of one single sql select?

759


Can we write ddl statements in functions?

800


Can you have more than one trigger on a table?

712


Are subqueries better than joins?

719


what are the features and advantages of object-oriented programming? : Sql dba

728


What is data control language?

736


define join and explain different type of joins? : Sql dba

736


How do you select unique values in sql?

710