find the second highest salary of the emp table

Answer Posted / chiru

select distinct sal
from Employee e1
where 3 = (select count(distinct sal) from Employee e2
where e2.sal >= e1.sal)
order by sal desc

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of tables supported by oracle?

580


What is java oracle used for?

527


Explain what does a control file contain?

613


What is max rowid in oracle?

559


What privilege is needed for a user to create indexes in oracle?

580






How to assign query results to variables?

594


What is the difference between primary key and unique key and foreign key in oracle?

554


How to get a create statement for an existing table?

572


Explain a data segment?

650


What are the attributes of the cursor?

561


What is null value in oracle?

638


How to create a table index?

568


What is a user account in oracle?

631


How to check your oracle database 10g xe installation?

581


How do I use unicode codesets with the weblogic jdriver for oracle driver?

556