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

explain the delete statements in sql

1061


Explain what is table in a database?

1058


what are the drivers in mysql? : Sql dba

1021


Is a secondary key the same as a foreign key?

1038


Why do we use %rowtype & %type in plsql?

1051


What kind of join is join?

973


How to process query result in pl/sql?

1129


Why is a primary key important?

1044


What are the ways on commenting in a pl/sql code?

1135


How can I tell if sql is running?

1066


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

1064


How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?

1051


How can use stored procedures in sql?

1140


Can we use insert statement in function?

1003


What normalization means?

979