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
How do I count records in sql?
How to display the records between two range in Oracle SQL Plus?
Does oracle roll back the transaction on an error?
What is a boolean in sql?
What is pivot in sql?
What is difference between left and right outer join?
How do you drop a trigger?
Why do we need cursors in pl sql?
how many sql dml commands are supported by 'mysql'? : Sql dba
Why truncate is used in sql?
What is the importance of sqlcode and sqlerrm?
What are sql objects?
Is sql better than excel?
What is pivot query?
What is exit statement?