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

Difference between pre-select and pre-query

1097


What is parameterized cursor in oracle?

1132


How to write date and time literals in oracle?

996


How to find out what oracle odbc drivers are installed?

1034


Explain the use of inctype option in exp command.

1025


when we are importing items in inventory, showing errors, Oracle support suggested us for running scripts & also suggested if we run scripts, iprocurement applicaation if is there it will show shared and if we go in future for iprocurement, it wont work. So kinldy suggest any functional solution.

1991


How oracle handles dead locks?

1064


What is oracle thin client?

1019


How to call a sub procedure?

1089


What is meant by a deadlock situation?

1102


Explain the use of indexes option in exp command.

1137


Explain the difference between replace() and translate() functions in oracle?

1027


you are a universe designer and report developer in BO, what type of information you gather from client?Briefly explain plz

1936


What is an anonymous block?

1229


State some uses of redo log files?

995