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 get second highest salary from a table

Answer Posted / srinivas

select * from emp m where(select count(distinct sal)+1 from emp s where s.sal>m.sal)=2

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

1001


Why is there a need for sqlcode and sqlerrm variables?

1048


how to create a table index in mysql? : Sql dba

1061


How can one get sql*loader to commit only at the end of the load file? : aql loader

1059


How can you get sql*loader to commit only at the end of the load file? : aql loader

1014


Define union, minus, union all, intersect ?

1006


What is self-join and what is the requirement of self-join?

1151


What is data definition language?

1092


Why we use stored procedure instead of query?

999


Why is nosql good?

1025


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

960


What are the advantages of indexing?

986


How do I run a sql query?

1021


what is the difference between nested subquery and correlated subquery?

1055


Which is faster view or stored procedure?

946