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 / vijay kintali

select e1.ename,e1.sal from emp e1 where n=(select count
(distinct e2.sal) from emp e2 where e1.sal<=e2.sal);

Note:n here is nth highest salary.......

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is union?

1253


Can you inner join the same table?

1039


Is sql a dbms?

1063


What are basic techniques of indexing?

1442


what does myisamchk do? : Sql dba

1079


What are the different datatypes available in PL/SQL?

1149


What is meant by <> in sql?

1029


Why should I use postgresql?

1069


Explain normalization and what are the advantages of it?

1000


Is it mandatory for the primary key to be given a value when a new record is inserted?

1254


Is there a way to automate sql execution from the command-line, batch job or shell script?

1018


Is nosql relational?

1002


What is index example?

1048


Why indexing is needed?

1046


What are the different types of joins in sql?

1914