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

Explain cascading triggers.

578


Give syntax for SQL and ORACLE joins.

644


How to delete multiple rows from a table in oracle?

573


Is it possible to center an object horizontally in a repeating frame that has a variable horizontal size ?

1888


Explain the difference between sap and oracle?

586






What is the data pump export utility?

657


What are joins, explain all types of joins?

1732


How to select an oracle system id (sid)?

598


Explain rename?

564


How to connect the oracle server as sysdba?

640


What are a cluster and non-cluster index?

584


What is null value in oracle?

644


What are the different editions of oracle?

603


Respected sir, Please send me technical questions related to oracle apps..

1389


I have a table called 'test' on source and target with same name, structure and data type but in a different column order. How can you setup replication for this table?

632