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 happens if null values are involved in expressions? : Sql dba

1001


Does sql*plus also have a pl/sql engine?

1039


What is graph sql?

938


Is there a 64 bit version of ssms?

896


Which are sql * plus commands?

1043


What are character functions in sql?

893


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

975


Explain the select statement in sql?

1045


Is not null in sql?

932


How to select all records from the table?

1069


Explain the uses of a database trigger?

985


How do you update a value in sql?

988


What are the three forms of normalization?

996


What is primary key and foreign key?

917


How do I order by ascending in sql?

958