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
What is an oracle data file?
What is a sub query and what are the different types of subqueries?
What privilege is needed for a user to delete rows from tables in another schema?
What is translate in oracle?
What are the system predefined user roles?
What is the difference between $oracle_base and $oracle_home?
how the Oracle Prepares the Execution Plan and how it chooses the Optimal one?
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
How many data types are supported?
How to write an inner join with the where clause in oracle?
How to best split csv strings in oracle 9i?
while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511
What is an oracle wallet?
How to commit the current transaction in oracle?
When do you get a .pll extension in oracle?