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 / ram posam

select * from (select deptno,sal,rank() over(partition by
deptno order by sal desc) k
from emp
group by deptno,sal)
where k=&n;

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 differences between lov and list item?

987


What are the common oracle dba tasks?

1068


Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?

945


What are triggers in oracle?

974


How to sort output in descending order in oracle?

983


What is oracle open database communication (odbc)?

957


What would you do with an in-doubt distributed transaction?

1911


How to write a query with a right outer join in oracle?

1108


What is the relationship among database, tablespace and data file?

926


types of indexes and the rationale behind choosing a particular index for a situation.

2443


What is the use of file param in imp command?

1112


Define the SGA and: How you would configure SGA for a mid-sized OLTP environment? What is involved in tuning the SGA?

2215


What privilege is needed for a user to insert rows to tables in another schema?

954


What is an oracle user role?

936


What is transport network substrate (tns) in oracle?

989