how to calcuate the second highest salary of he employee
Answer Posted / ramya p
SELECT DISTINCT (sal),deptno FROM emp a
WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM emp b
WHERE a.sal<=b.sal)
N is the Nth highest salary you want to print. In this case
N=2
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Why use truncate instead of delete?
What are secondary keys?
What is sqlca in db2?
What packages(if any) has oracle provided for use by developers?
how is myisam table stored? : Sql dba
What is secondary key?
what is view? : Sql dba
What is mutating error in pl sql?
What is sql query optimization?
What is assignment operator in pl sql?
Any attempt to navigate programmatically to disabled form in a call_form stack is allowed?
How do you concatenate in sql?
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 the difference between execution of triggers and stored procedures?
what is innodb? : Sql dba