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 happens to indexes if you drop a table?
How many types of segments in Oracle?
What are the different types of modules in oracle forms?
Which dictionary tables and/or views would you look at to diagnose a locking issue?
What is rich query?
How to upsert (update or insert into a table)?
What are the database administrators utilities available?
i have a question here... As of my knowledge, when we apply an index (b-tree)on a column, internally it arranges the data in b-tree format and do the fetching process correspondingly... and my quetion is... How a bit-map index arranges the data internally when applied on a column?IS it in b-tree format or whatelse?
How to pass a parameter to a cursor in oracle?
What is the use of file param in imp command?
Can a formula column be obtained through a select statement ?
How to pass parameters to procedures?
How to create a single index for multiple columns?
Explain about integrity constraint?
What is a trigger oracle?