how to get the second max val for every group in a table

Answer Posted / venkat

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 ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to synchronize 2 schema's objects?

1687


What is a dynamic performance view in oracle?

604


How to concatenate two text values in oracle?

589


how the Oracle Prepares the Execution Plan and how it chooses the Optimal one?

1823


What are the differences between date and timestamp in oracle?

549






What is the difference between Delete, Truncate and Drop in Oracle?

602


Can select statements be used on views in oracle?

590


How do I know if oracle client is installed on windows?

494


Explain what does a control file contain?

607


does the query needs a hint to access a materialized view?

1462


What is an oracle function?

595


How to call a sub procedure?

562


How to use existing values in update statements using oracle?

545


What is instant client oracle?

539


What is the usage of analyze command in oracle?

609