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 / samir kumar sahoo

SELECT sal FROM(SELECT DISTINCT(sal) FROM employees ORDER
BY sal DESC) WHERE ROWNUM<=2;

Is This Answer Correct ?    23 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are dml statements in oracle?

1132


What do you mean by a deadlock?

1109


What is oracle join syntax?

1063


How to create id with auto_increment on oracle?

1043


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

1126


Difference between cartesian join and cross join?

1093


How can we view last record added to a table?

1107


What is tns service name?

1179


What is snapshot is too old? Give and example for better understand.

1651


What are the differences between date and timestamp in oracle?

1097


Can we insert data in view oracle?

1120


What is the difference between 10g OEM and 11g OEM?

1017


How do we represent comments in oracle?

1098


How do you bind variables in oracle?

1024


Explain the use of rows option in imp command.

1139