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
Does truncate release storage space?
what is blob? : Sql dba
What is implicit cursor in pl sql?
what are the drivers in mysql? : Sql dba
Lookups are a key component in sql server integration services (ssis). Explain its purpose?
What is information schema in sql?
What is a column in a table?
what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba
What are the datatypes available in pl/sql ?
Is it possible to sort a column using a column alias?
What is the difference between subquery and correlated query?
What is the process of debugging?
How many types of triggers are there in pl sql?
Difference between global and parameter variables?
Which column of the user triggers data dictionary view displays the database event that will fire the trigger?