Write a query to find second highest salary of an employee.
Answer Posted / deepshikha
SELECT MAX (sal)
FROM emp a,
(SELECT MAX (sal) max_sal
FROM emp) abc
WHERE a.sal < abc.max_sal
ORDER BY sal DESC;
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
How to fetch values from testtable1 that are not in testtable2 without using not keyword?
Is not null in sql?
What is a natural join sql?
What are the benefits of stored procedures?
What is the main reason behind using an index?
What is transaction control language (tcl)?
Is left join and outer join same?
If the application is running very slow? At what points you need to go about the database in order to improve the performance?
What is sql*plus?
What is difference between mysql and postgresql?
How does join work in sql?
How to check if a column is nullable before setting to nullable?
What is function and procedure in pl sql?
Can we join 3 tables in sql?
what are the security recommendations while using mysql? : Sql dba