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 are date and time functions in mysql? : Sql dba
What are the triggers associated with image items?
What are the two parts of design view?
what is oracle database ? : Sql dba
What is the file extension for sql database?
Does sql use python?
How much does sql certification cost?
Can we use ddl commands in pl sql?
What is procedure and function?
Why do we create views in sql?
What is difference between db2 and sql?
what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba
Can we use the cursor's to create the collection in PL/SQL?
What does where 1/2 mean in sql?
how to do backup entire database? : Transact sql