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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / nathan
SELECT *
FROM (SELECT deptno, sal,
DENSE_RANK () OVER (PARTITION BY deptno ORDER
BY sal DESC)
ranks
FROM emp)
WHERE ranks = 2;
Is This Answer Correct ? | 2 Yes | 1 No |
How to apply filtering criteria at group level in oracle?
How to store only time; not date and time?
How do you find current date and time in oracle?
What is a read write transaction in oracle?
WHAT IS ecc 6.0
Calculate difference between 2 date / times in oracle sql?
An automatic job running via DBMS_JOB has failedKnowing only that its failed, how do you approach troubleshooting this issue?
How to invoke the data pump import utility?
What are group functions in oracle?
I know that i can create a table without a primary key.But is there any significance for that table???? while creating an application.
What are the varoius components of physical database structure of oracle database?
In Oracle Applications We are Using Sub Ledger Accounting. When we Transfer the Data all modules (AP,AR,CE,FA) to SLA We done Some customizations? What are They??