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 the purpose of primary key?
What is clause?
What is sql partition function?
Write a query to find the names of users that begin with "um" in sql?
Is the primary key an index?
Difference between global and parameter variables?
Can we create clustered index without primary key?
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
Mention what are the benefits of pl/sql packages?
Can we create table inside stored procedure?
How do I partition a table in sql?
What are the qualities of 2nf?
Is sql a scripting language?
Why do we need unique key in a table?
What are the syntax and use of the coalesce function?