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 server name sql?
define sql update statement ? : Sql dba
How does cross join work in sql?
Can we create a trigger on view?
what is top in tsql? : Transact sql
Mention what does plv msg allows you to do?
What is sqlcontext?
Explain the structure of pl/sql in brief.
How many subqueries can be nested in a statement?
How to run sql commands in sql*plus?
What are the sql commands?
If the application is running very slow? At what points you need to go about the database in order to improve the performance?
What is a join query?
What is trigger in sql? Explain
How can use stored procedures in sql?