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

Does truncate release storage space?

1085


what is blob? : Sql dba

1155


What is implicit cursor in pl sql?

1097


what are the drivers in mysql? : Sql dba

1027


Lookups are a key component in sql server integration services (ssis). Explain its purpose?

1010


What is information schema in sql?

1078


What is a column in a table?

1130


what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba

1008


What are the datatypes available in pl/sql ?

1110


Is it possible to sort a column using a column alias?

1055


What is the difference between subquery and correlated query?

1070


What is the process of debugging?

1078


How many types of triggers are there in pl sql?

1070


Difference between global and parameter variables?

1972


Which column of the user triggers data dictionary view displays the database event that will fire the trigger?

1029