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 the is the diff between local index and global index. give some example.
Why packages are used in oracle?
How to create an oracle database manually?
What are nested tables?
What is an external table?
What is data block in Oracle?
I have a table called 'test' on source and target with same name, structure and data type but in a different column order. How can you setup replication for this table?
What view(s) do you use to associate a users SQLPLUS session with his o/s process?
What is the effect of setting the value "all_rows" for optimizer_goal parameter of the alter session command? What are the factors that affect optimizer in choosing an optimization approach?
What privilege is needed for a user to create indexes in oracle?
What is a table index?
various types of hints and their usage
HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.
How to compare dates in oracle sql?
What are ddl statements in oracle?