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
What does where 1/2 mean in sql?
What is a memo field?
How to run sql statements with oracle sql developer?
Can pl sql procedure have a return statement?
How does a self join work?
What is sql profiling in oracle?
Explain the working of foreign key?
What is delimiter in pl sql?
What is materialized view. What are different methods of refresh?
Does execute immediate commit?
What is online transaction processing (oltp)?
What are the different sql languages?
what are local and global variables and their differences? : Sql dba
Do ddl statements need commit?
can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba