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 |
What do you understand by database schema and what does it hold?
How can we manage the gap in a primary key column created by a sequence? Ex:a company has empno as primary key generated by a sequence and some employees leaves in between.What is the best way to manage this gap?
what is load balancing and what u have used to do this?(sql loader)
List the various oracle database objects?
What are the oracle built-in data types?
Please explain compound trigger in oracle?
What is oracle host variable?
What is the difference between normal and corelated subqueries?
hi friends i completed b.com 2004.i have 3y accounting exp. in manufacturing company.now i have completed oracle finance.pls suggest me how will get job in oracle.can i get job in oracle.
Explain coalesce function?
What is meant by raw datatype?
Explain what are the different type of segments?