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
discuss about myisam index statistics collection. : Sql dba
How much does a sql dba make? : SQL DBA
Explain the uses of control file.
What is a constraint? Tell me about its various levels.
Is not equal in sql?
What is query execution plan in sql?
what is user defined functions? : Sql dba
What is a file delimiter?
explain advantages of myisam over innodb? : Sql dba
What are different clauses used in sql?
How to avoid duplicate records in a query?
What is posting?
What are the uses of sysdate and user keywords?
what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba
Why do we use subquery?