how to find the second highest salary from emp table?
Answer Posted / sujith
Here is the query to find not only 2nd highest salary, but
nth highest salary also by changing n value......
select e.* from (select * from emp order by sal desc) e
where rownum<=n
minus
select e.* from (select * from emp order by sal desc) e
where rownum<n
This will the record of the person who draws nth highest
salary.........
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is Materialized View? In What Scenario we Use Materialized View?
Explain scalar functions in sql?
What is clause in sql?
how to calculate expressions with sql statements? : Sql dba
Show the cursor attributes of pl/sql.
Which is faster view or stored procedure?
What is the difference between left outer join and left join?
Why are indexes and views important to an organization?
Why is pl sql needed?
What is #table in sql?
How do I view tables in mysql?
what is an extent ? : Sql dba
Is natural join same as inner join?
Is left join faster than inner join?
What is the purpose of my sql?