Answer Posted / prabhudatta barick
--IN ORDER TO FIND THE NTH HIGHEST SALARY,
--WE JUST FIND THE SALARY THAT HAS EXACTLY N-1 SALARIES
GREATER THAN ITSELF---
--This is correlated subquery--
select empno,
ename,
sal
from scott.emp e
where &n-1=(select count(distinct b.sal) from scott.emp b
where b.sal>e.sal);
To get second highest salary put n value 2.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the uses of Database Trigger ?
Can we protect our pl/sql source code?
What is merge in oracle?
Explain enable novalidate constraint.
Explain view?
What is the Tune Query
Explain the use of control file?
ABOUT IDENTITY?
Please explain oracle data types with examples?
How to use null as conditions in oracle?
Is it possible to split the print reviewer into more than one region ?
What is archive log in Oracle?
List out the difference between commit, rollback, and savepoint?
When do you get a .pll extension in oracle?
How to add a new column to an existing table in oracle?