how can find the second max sal for every group(i.e i want
group the data based on key and find the second max sal for
every group
Answer Posted / sudipta santra
select max(sal),group_nm from
( select sal,dense_rank over (order by sal desc) rank,group_nm
from emp )
where rank=&n
group by group_nm;
Note: here &n is the bind variable which holds value from
the user, based on the requirement either 2nd max or 3rd max
or 5th max.
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is bulk collect in oracle?
How to concatenate two text values in oracle?
Explain the use of owner option in exp command.
How do I use os authentication with weblogic jdriver for oracle and connection pools?
What privilege is needed for a user to query tables in another schema?
How to update values in a table in oracle?
How to run the anonymous block again?
What is the difference between postgresql and oracle?
What is proxy method?
What is oracle database client?
What is oracle rownum?
Can you tell me how to add new column in existing views?how?How is possible?
How to experiment a data lock in oracle?
What is system global area (sga) in oracle?
What is a trigger oracle?