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

In MS SQL I was able to run the query:
select min(sal) from emp where sal in ( select top 2 sal
from emp order by desc)

but i was not able to run similar query in MySQL 5.1.41


select min(e_sal) from employee where e_sal in (select e_sal
from employee order by e_sal desc limit 2);

MySQL gives the following error:

ERROR 1235 (42000): This version of MySQL doesn't yet
support 'LIMIT & IN/ALL/ANY/SOME subquery'

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does where 1/2 mean in sql?

1145


What is a memo field?

1019


How to run sql statements with oracle sql developer?

1123


Can pl sql procedure have a return statement?

1072


How does a self join work?

1237


What is sql profiling in oracle?

1133


Explain the working of foreign key?

1136


What is delimiter in pl sql?

1102


What is materialized view. What are different methods of refresh?

1442


Does execute immediate commit?

1291


What is online transaction processing (oltp)?

1068


What are the different sql languages?

1093


what are local and global variables and their differences? : Sql dba

1139


Do ddl statements need commit?

1023


can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba

1048