Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What happens to indexes if you drop a table?

1222


How many types of segments in Oracle?

1114


What are the different types of modules in oracle forms?

1047


Which dictionary tables and/or views would you look at to diagnose a locking issue?

1951


What is rich query?

1032


How to upsert (update or insert into a table)?

1042


What are the database administrators utilities available?

1094


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?

2006


How to pass a parameter to a cursor in oracle?

1229


What is the use of file param in imp command?

1215


Can a formula column be obtained through a select statement ?

2380


How to pass parameters to procedures?

1088


How to create a single index for multiple columns?

1080


Explain about integrity constraint?

1176


What is a trigger oracle?

1136