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 suggestions do you have to reduce the network traffic?
How to invoke the data pump export utility?
"primary key=unique+null" is equal,reson?not,reason?
find out the second highest salary?
55 Answers Cognizant, Nucsoft, Oracle, TCS, Wondersoft,
What is Normalization ?
55 Answers ACS, Genpact, Graphix Solution, IBM, Keane India Ltd, TCS, Vault,
What is oracle thin client?
candidate key is subset of super key but not vice-verse explain
How to declare a local variable?
hello friends Im doing my final year engineering in B.Tech.. one of uncle said he can provide job in his company if im good in database management. but i have only basic knowledge about database, so like to join database management course in good intuition. so friends kindly help me to get good intuition because its my future.
WHAT IS ecc 6.0
Explain the use of Merge statement in oracle 11g
What happens to indexes if you drop a table?