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
What is structural independence and why is it important?
How do you update f as m and m as f from the below table testtable?
is it possible to pass an object or table to a procedure as an argument?
What is the difference between the implicit and explicit cursors?
Mention what are different methods to trace the pl/sql code?
What is the difference between numeric and autonumber?
What is auto increment in sql?
Define overloaded procedure?
Can we connect to postgresql using sql developer?
Why is pl sql used?
What is a database? Explain
Is ms sql is free?
What are the types of records?
What is consistency?
What are the events on which a database trigger can be based?