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 |
Explain what are clusters?
how to use select statement as formal parameter in procedure specification?(someone said that using string) ex:-procedure(a in number,select ename from emp ) i am asking syntax like this?
does Oracle has only one table space?
Can a View based on another View ?
Explain the relationship among Database, Tablespace and Data file?
How can we force the database to use the user specified rollback segment?
How to rename an existing table?
Which Functions Using Integer ==> String's i.e 2 ==> Two... Like that string's ==> integer values ? It is Possible ?
what is main def between plsql/table and array?
I have query like this. select dept_id, max_mark from stude_dept where min_mark= (select min(mini_mark) from stud_dept); How can i optimize this query. Can anyone help me with it
Whether any commands are used for months calculation? If so, what are they?
What is Hash Cluster ?