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 |
I have my backup RMAN script called backup_rman.sh. I am on the target database. My catalog username/password is rman/rman. My catalog db is called rman. How would you run this shell script from the O/S such that it would run as a background process?
How do I connect to oracle?
How to create a new view in oracle?
can you call insert/update/delete in select statements. If yes how? If no what is the other way?
What is an oracle?
what are actual and formal parameters?
Explain a private synonyms?
Why do we need integrity constraints in a database?
if i have a procedure with 1000 line.when i run this in 61 line i got the error but i want to continue the programe without error.can anyone tell me how to handle that error.
How do I manually uninstall oracle client?
How to define and use table alias names in oracle?
Whether any commands are used for months calculation? If so, what are they?