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 / manikishore

select * from emp e where
2 =(select count(distinct sal) from emp where e.sal<=sal);


//if you want to retrieve 3rd max(sal) then you can use 3 in place of 2,,,like that for so on..

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pl sql collection?

962


what is the difference between delete and truncate commands? : Sql dba

1067


How to run sql functions in pl/sql?

1052


The in operator may be used if you know the exact value you want to return for at least one of the columns.

1127


Does truncate table reset auto increment?

991


What is an ndf file?

991


What trigger means?

975


what are different types of keys in sql?

1145


What is the execution plan in sql?

1021


Can we join tables without foreign key?

958


Does oracle roll back the transaction on an error?

1012


Differentiate between sga and pga.

1161


What is left join example?

945


Does inner join return duplicate rows?

974


Can we use commit inside a trigger?

1086