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...

Query to get max and second max in oracle in one query ?

Answer Posted / rohit

The below query will provide the max and second max in
oracle in one query

select * from emp e
where 0 = (select count(sal) from emp
where e.sal < sal)
or 1 = (select count(sal) from emp
where e.sal < sal);

Is This Answer Correct ?    17 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to join two tables in a single query using oracle?

928


How to convert numbers to characters in oracle?

966


What is an oracle table?

929


Can a formula column referred to columns in higher group ?

2455


Hi Masters, in Oracle Applications 11i, we hace 2 functions using the same form, i need to create 1 personalization, but that code must afect only one function.... how can i do that?

2172


 How to use an oracle sequence generator in a mapping?

1016


What is background process in Oracle?

1049


What is oracle database client?

973


Explain an index segment?

1037


Does oracle charge for java?

1005


What are the attributes of cursor?

987


What are the four Oracle system processes that must always be up and running for the database to be useable?

953


Is java required for oracle client?

921


What are the set operators union, union all, minus & intersect meant to do?

935


What is memory advisor in Oracle?

1021