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

You can find nth max salary

change "limit 0,n" where n = 1,2,3...

select b.sal from (select a.sal from (select distinct sal
from emp order by sal desc) a limit 0,n) b order by sal asc
limit 0,1;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I add a database to sql?

1136


What is compiled query?

1043


what is the difference between primary key and unique key? : Sql dba

1043


What is cross join sql?

926


What are reports usually used for?

1035


How do you break a loop in pl sql?

1057


What is rowtype?

1028


Which operator is used in query for pattern matching?

1096


what are the non-standard sql commands supported by 'mysql'? : Sql dba

1131


How to avoid using cursors? What to use instead of cursor and in what cases to do so?

1199


Is the primary key an index?

1031


Difference between table function and pipelined function?

1030


how are mysql timestamps seen to a user? : Sql dba

1148


What is the difference between joins?

1048


how can we take a backup of a mysql table and how can we restore it. ? : Sql dba

978