find out the third highest salary?

Answer Posted / haneef

Best One

select top 1 * from test_emp where sal in (select top 3 sal
from test_emp order by sal desc) order by sal asc

or

It also work

select top 1 * from test_emp where sal in (select top 3 sal
from test_emp order by sal desc) order by sal asc
select top 1 MAX(sal),id from test_emp where sal < (select
max(sal) from test_emp where sal < (select max(sal) from
test_emp))
group by id,sal order by sal desc

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Whats the benefit of dbms_stats over analyze?

1495


What is oracle join syntax?

570


How to create a single index for multiple columns?

560


List the types of joins used in writing subqueries?

573


Calculate difference between 2 date / times in oracle sql?

570






How to convert a string to a date in oracle database?

542


Explain a segment?

617


What is translate in oracle?

616


How to create a table interactively?

556


Please explain me all types of Data models. Also give me the details if each model can have other name.for example:schematic data model is also known as conceptual data model and entity relation data model.

1865


what are steps for interface? where is exchange rate defined in which table?

1495


How to open and close an explicit cursor in oracle?

574


What do you mean by a database transaction & what all tcl statements are available in oracle?

549


Explain the use of ignore option in imp command.

573


Can a formula column be obtained through a select statement ?

1843