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

Which command is used to delete a trigger?

1404


What is the difference between python and sql?

1051


Is postgresql a server?

1109


What is an invalid partition table?

1065


What is the difference between clustered and non-clustered indexes?

1128


Which is faster count (*) or count 1?

1088


What are sql functions? Describe in brief different types of sql functions?

1179


What is the difference between a subquery and a join?

1170


How many joins in sql?

1055


What plvcmt and plvrb does in pl/sql?

1366


What is sp_helptext?

1110


Is truncate ddl or dml?

1038


What sql does db2 use?

1028


What are different types of triggers?

1180


What is data control language (dcl)?

1204