i need department wise top 2 employees salary.which logic
i will use
Answer Posted / neetika vardhan
SELECT dept, MAX(sal)
FROM EMP WHERE sal NOT IN (SELECT MAX(sal) FROM emp GROUP
BY dept)
GROUP BY dept
UNION
SELECT dept, MAX(sal)
FROM EMP
GROUP BY dept
Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
What are the 3 modes of parameter?
What is a natural join?
How do I view an execution plan in sql?
What does (*) mean in sql?
What are the parameter modes supported by pl/sql?
What is tuple in sql?
Difference between truncate, delete and drop commands?
What is difference between primary and secondary key?
Can we have two clustered index on a table?
How do I save the results of sql query in a file?
How many functions are there in sql?
What does the base_object_type column shows in the user.triggers data dictionary view?
what is a composite key ? : Sql dba
Is pl sql still used?
How to select unique records from a table?