i need department wise top 2 employees salary.which logic
i will use
Answer Posted / kavitha
SELECT distinct a.department_id, a.salary
FROM (SELECT department_id, salary,
DENSE_RANK () OVER (PARTITION BY department_id ORDER BY salary DESC NULLS LAST) max_sal
FROM employees
WHERE department_id IS NOT NULL) a
WHERE max_sal <= 2
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Is nosql relational?
Is json a nosql?
How do I partition a table in sql?
What type of database is cloud sql?
Is stored procedure faster than query?
What is the difference between an inner and outer join?
What is out parameter used for eventhough return statement can also be used in pl/sql?
What is schema in sql example?
Can we delete column in sql?
How would you pass hints to the sql processor?
What does the sign mean in sql?
what is a database transaction? : Sql dba
How many types of triggers exist in pl/sql?
Is postgresql a server?
What is sql query optimization?