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 are the four Oracle system processes that must always be up and running for the database to be useable?

989


Explain what are the type of synonyms?

1089


How to fetch the row which has the max value for a column?

981


Give the advantages and disadvantages of clusters.

1036


Explain oracle left join with an example?

983


I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.

2170


Can multiple columns be used in group by in oracle?

958


How to define default values for formal parameters?

1023


How to drop a stored procedure in oracle?

1031


What are the differences between number and binary_float in oracle?

1089


How to create a new tablespace in oracle?

965


How to assign a table row to a record variable?

1009


What is the difference between substr and instr?

1018


What are the different oracle database objects?

1075


what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?

2256