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

select sal from emp a where 1=(select count(*) from emp b where a.sal>b.sal);

Try this guys,if u want highest sal use 0 in where condition, for second highest 1,third 2........

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql injection vulnerability?

948


What is the purpose of primary key?

1029


What is dml and ddl?

959


what is 'mysqldump'? : Sql dba

1111


how mysql optimizes distinct? : Sql dba

1083


What is pivot table in sql?

1115


What is the left table in sql?

967


Sql technical questions

1283


what does it mean to have quoted_identifier on? : Sql dba

1146


What are types of exception?

922


What is sql prepared statement?

989


how many sql ddl commands are supported by 'mysql'? : Sql dba

1025


What is sql partition function?

1215


What is the syntax and use of the coalesce function?

1175


What is the sql*loader? : aql loader

1056