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 subquery mean in sql?

1046


What are the different set operators available in sql?

1022


Why use triggers in sql?

954


what is online transaction processing (oltp)? : Sql dba

992


what is data manipulation language? : Sql dba

1012


What is a nested table in word?

952


What is sql data?

988


what is query cache in mysql? : Sql dba

1031


Difference between truncate, delete and drop commands?

1081


Can we use view in stored procedure?

894


How to select 10 records from a table?

1153


What is blind sql injection?

1068


how to get @@error and @@rowcount at the same time? : Sql dba

1021


Why schema is used in sql?

1047


What is the difference between sql and t sql?

1031