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

Answer Posted / manoranjan

to select the nth highest salary from emp table

select distinct(a.sal) from emp a where &n=
(select count(distinct(b.sal))from emp b where a.sal<=b.sal);

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between local and global temporary table?

548


Mention what pl/sql package consists of?

535


What does varchar include?

517


Which language is used in sql?

516


How is a PL/SQL code compiled?

666






What is secondary key?

508


Is not null in sql?

560


How to write html code in pl sql?

580


How to get each name only once from an employee table?

606


How global cursor can be declare with dynamic trigger ?

1746


What is the difference between alter trigger and drop trigger statements?

599


Which data dictionary views have the information on the triggers that are available in the database?

752


What is %type in sql?

510


How delete a row in sql?

533


How many triggers can be applied on a table?

508