Write a query to find second highest salary of an employee.
Answer Posted / manoranjan
to select the nth highest salary from emp table
select distinct(a.sal) from emp a where &n=
(select count(distinct(b.sal))from emp b where a.sal<=b.sal);
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is sql*plus?
How to select random rows from a table?
Why partition by is used in sql?
Is sql between inclusive?
what is self join and what is the requirement of self join? : Sql dba
How do I count duplicates in sql?
What is vector point function?
How do you add a column to a table?
How do you remove duplicates without using distinct in sql?
Is oracel sql developer written in java?
What sql does db2 use?
What is difference between hql and sql?
How do I install sql?
What is the primary key?
Describe types of sql statements?