how to find the second highest salary from emp table?
Answer Posted / gokul
In MySQL, this query will be easier to find 2nd highest
salary and to fetch all the fields from a table.
select * from emp where sal not in (select max(sal)
from emp) order by sal desc limit 1
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
How can we make an if statement within a select statement?
How long does it take to learn pl sql?
How to start oracle sql developer?
Do stored procedures prevent sql injection?
how to start mysql server? : Sql dba
how to create a new view in mysql? : Sql dba
What is a natural join?
what are the security recommendations while using mysql? : Sql dba
Advantages and disadvantages of stored procedure?
What is multiple partition?
What does the argument [or replace] do?
How do we accept inputs from user during runtime?
How do I make my sql query run faster?
Is not null in sql?
What are the sql aggregate functions?