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 / ajit

select max(sal),1 no
from emp
union
select sal,rn from (select sal,rownum rn from emp)
where rn = 2
order by 1 desc;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is oracle update statement with inner join ?

1068


In SAP ECC 6.0 , under DB02 tcode , Tablespace name to be explain stepy step all the col

4180


Iam learning oracle developer 2000.. can anyone give me then tutorials sites or PDF related to developer 2000 please send me the details @ mak2786@gmail.com thanks Arun

2192


List out the difference between commit, rollback, and savepoint?

1046


What is the max number of columns in an oracle table?

1003


What is recovery manager in Oracle?

1061


What is the relation of a user account and a schema?

1134


Who developed oracle & when?

1012


How to install oracle database 10g xe?

1024


Explain what are the uses of rollback segment?

1021


What are operators in oracle?

1064


How many types of auditing in Oracle?

1037


What is bulk copy or bcp in oracle?

1129


What do you understand by database schema and what does it hold?

1237


What is primefaces used for?

1056