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 send sql query results to excel?
what is the difference between join and union? : Sql dba
What are the types pl/sql code blocks?
What is sql table?
Is mariadb a nosql database?
What are all different types of collation sensitivity?
What does varchar include?
How do I kill a query in postgresql?
What is rowtype?
what are string data types? : Sql dba
Explain the difference between triggers and constraints?
What are packages in pl sql and also explain its advantages?
What version is sql?
how many columns can be used for creating index? : Sql dba
Which join is default?