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

how to find the second highest salary from emp table?

Answer Posted / nalini

Follow the following Query, You get the second highest
salary.
SQL> Select level,Max(sal) from emp
Where level=&level connect by prior sal>sal
group by level;
SQL> Enter the level No=2 (Here enter 2 manually)

Then you will get the 2nd highest salary.
If you want 3rd Highest salary, then enter level no=3.

Is This Answer Correct ?    208 Yes 105 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better join or inner query?

960


How do I run a sql script?

1052


what are aggregate and scalar functions? : Sql dba

993


Can you load data into multiple tables at once? : aql loader

1020


Can we create foreign key without primary key?

931


What is before and after trigger?

890


What is the difference between between and in condition operators?

939


Is postgresql a nosql database?

1073


Which is better stored procedure or query?

918


How do I find duplicates in sql?

876


How do I run a script in sql developer?

898


What is the purpose of a sql?

913


Why is partition used in sql?

1049


How do you declare a constant?

909


what is the difference between ereg_replace() and eregi_replace()? : Sql dba

1071