how to find the second highest salary from emp table?
Answer Posted / arun
select distinct (a.salary) from employees a
where &N = (select count (distinct(b.salary))
from employees b where a.salary <= b.salary);
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is the primary key an index?
Difference between truncate, delete and drop commands?
what is a control file ? : Sql dba
What is record data type?
What is difference between stored procedure and trigger?
What is an exception in PL/SQL? What are the two types of exceptions?
What is ttitle and btitle?
what is the difference between a having clause and a where clause? : Sql dba
Explain the difference between triggers and constraints?
What is the advantage of nosql?
What is the difference between distinct and unique in sql?
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
What is nvarchar in sql?
what are the different type of sql's statements ? : Sql dba
Can a table have no primary key?