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 subquery mean in sql?
What are the different set operators available in sql?
Why use triggers in sql?
what is online transaction processing (oltp)? : Sql dba
what is data manipulation language? : Sql dba
What is a nested table in word?
What is sql data?
what is query cache in mysql? : Sql dba
Difference between truncate, delete and drop commands?
Can we use view in stored procedure?
How to select 10 records from a table?
What is blind sql injection?
how to get @@error and @@rowcount at the same time? : Sql dba
Why schema is used in sql?
What is the difference between sql and t sql?