how to find the second highest salary from emp table?
Answer Posted / nalini
Follow the following Query, You get the second highest
salary.
SQL> Select level,Max(sal) from emp
Where level=&level connect by prior sal>sal
group by level;
SQL> Enter the level No=2 (Here enter 2 manually)
Then you will get the 2nd highest salary.
If you want 3rd Highest salary, then enter level no=3.
| Is This Answer Correct ? | 208 Yes | 105 No |
Post New Answer View All Answers
What are all the common sql functions?
Which data type is a composite type?
Why we use joins in sql?
What are the disadvantages of file system?
What is the maximum database size for sql express?
Does sqlite need a server?
what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql
Does db2 use sql?
What are the basic techniques of indexing?
How do I view stored procedures?
what is msql? : Sql dba
What is sql integrity?
What does cursor do in sql?
Does group by remove duplicates?
What is sql profiler in oracle?