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

Explain clause in sql?

1071


Why is theta join required?

1188


What is int identity in sql?

1206


What are different types of sql?

1263


what is unique key constraint? : Sql dba

1096


What are database links used for?

1095


Is sql an operating system?

1072


What are functions in sql?

995


Why partition by is used in sql?

1083


What is the difference between view and stored procedure?

1000


What are different types of statements supported by sql?

1209


What is a heap in sql?

1140


Is sql sequential or random?

1086


What is the difference between clustered and non-clustered indexes?

1128


What is the difference between inner join and left join?

1036