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
How do sql triggers work?
What is a dynamic query?
define sql update statement ? : Sql dba
How many types of literals are available in pl sql?
Why do we use function in pl sql?
Do foreign keys improve performance?
what is a database? : Sql dba
What is memory optimized table?
What is number function in sql?
How does one use sql*loader to load images, sound clips and documents? : aql loader
how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba
how many triggers are allowed in mysql table? : Sql dba
What are the types of views in sql?
what are the 'mysql' command line options? : Sql dba
What is on delete set null?