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 does the t-sql command ident_incr does? : Transact sql
How does one use sql*loader to load images, sound clips and documents? : aql loader
What is set transaction?
How do I restart sql?
Can dml statements be used in pl/sql?
What are the set operators in sql?
Is left join inner or outer by default?
What are aggregate and scalar functions?
How does an execution block start and end in pl sql?
What are local and global variables and their differences?
Is left join faster than inner join?
How many types of privileges are available in sql?
explain about mysql and its features. : Sql dba
Can we use the cursor's to create the collection in PL/SQL?
How to use transactions efficiently : transact sql