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 do the 9i dbms_standard.sql_txt() and dbms_standard.sql_text() procedures do?
Using the relations and the rules set out in the notes under each relation, write table create statements for the relations EMPLOYEE, FIRE and DESPATCH. You should aim to provide each constraint with a formal name, for example table_column_pk.
How to delete an existing row from a table in oracle?
Can sub procedure/function be called recursively?
What is a parameter file in oracle?
How to execute the package in oracle?
How to get last row id?
What is connection pool in oracle?
Can we convert a date to char in oracle and if so, what would be the syntax?
What is meant by joins? List out the types of joins.
What is Segment Advisor in Oracle?
Explain temporal data types in oracle
Can we use oracle pl/sql block in core java? if so how? pls get back to me .....
What is transaction control statement and how many types of transaction control statement in Oracle?
How to work with data objects interactively?