how to get the second max val for every group in a table
Answer Posted / suman rana
--venkat u r almost correct, since u have used "" (double
quotes) so column name will be come case sensitive.
select * from (
select e.deptno,d.dname,e.sal,dense_rank() over (
partition by e.deptno
order by e.sal desc ) RANK, e.ename
from emp_test e,dept_test d where e.deptno=d.deptno)
where rank=2
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the four Oracle system processes that must always be up and running for the database to be useable?
Explain what are the type of synonyms?
How to fetch the row which has the max value for a column?
Give the advantages and disadvantages of clusters.
Explain oracle left join with an example?
I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.
Can multiple columns be used in group by in oracle?
How to define default values for formal parameters?
How to drop a stored procedure in oracle?
What are the differences between number and binary_float in oracle?
How to create a new tablespace in oracle?
How to assign a table row to a record variable?
What is the difference between substr and instr?
What are the different oracle database objects?
what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?