how to find the second highest salary from emp table?

Answer Posted / shalina bajaj

select sal from emp a
where $number = (select count(distinct(sal))
from emp b
where a.sal <= b.sal);

Is This Answer Correct ?    11 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the basic form of sql query?

491


Enlist the characteristics of pl/sql?

1235


Can a foreign key have a different name?

510


What is basic structure of pl sql?

494


Can you selectively load only those records that you need? : aql loader

605






what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql

496


How do I copy a table in sql?

515


What is AUTH_ID and AUTH_USER in pl/sql ?

1688


Does sql full backup truncate logs?

527


Is a foreign key always unique?

528


What is an inner join sql?

542


What is a temp table?

561


Can we rollback after truncate?

558


Can we create foreign key without primary key?

530


What is execution plan in sql?

542