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 / purna chowdary

Select Sal From Emp A
WHERE 1=(Select Count(Sal) From Emp B
WHERE B.Sal>A.sal)
GROUP By Sal Desc

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the blob datatype?

1122


How to define an oracle sub procedure?

1220


What is SQL access advisor in Oracle?

1228


How to get execution path reports on query statements?

1041


What happens to the current transaction if the session is killed?

1033


How to display row numbers with the records?

1132


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

1218


What happens to indexes if you drop a table?

1222


How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?

2311


21. Using a set operator, display the client number of all clients who have ever placed an order and whose whose name does not contain the string Sm.

2165


Explain the difference between a procedure and a function? What do you understand by those terms?

1125


How many file formats are supported to export data?

1263


What exactly do quotation marks around the table name do?

1016


How to use an explicit cursor without open statements?

1097


What is the usage of save points in oracle database?

1011