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

What is the current version of sql?

1023


In what condition is it good to disable a trigger?

1013


How do I know if I have sql express or standard?

1032


What is difference between pl and sql?

1063


Can procedure in package be overloaded?

1085


How many aggregate functions are available there in sql?

984


Can we use the cursor's to create the collection in PL/SQL?

1028


what is user defined functions? : Sql dba

1035


Where is pl sql used?

954


Is it possible to include an insert statement on the same table to which the trigger is assigned?

1016


Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

1209


What is sp_helptext?

1069


Explain lock escalation? : Transact sql

1198


What is having clause in sql?

966


How many clustered indexes can you have?

975