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 is the use of friend function? : Sql dba
Can we use ddl commands in pl sql?
Is it possible to create the following trigger: before or after update trigger for each row?
ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..
what is self-join? : Sql dba
What are database links used for?
Which data dictionary views have the information on the triggers that are available in the database?
What is a scalar value in sql?
What is multiple partition?
Can you join a table to itself?
How do I debug a stored procedure?
What is the difference between an inner and outer join?
I need a function for a train ticket reservation please answer it thanks in advance
How many tables can a sql database have?
What are the benefits of triggers?