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
Can sql function call stored procedure?
Is progress software supports to ( pl/sql )?
What is the size of partition table?
What is an exception in pl/sql?
Lookups are a key component in sql server integration services (ssis). Explain its purpose?
How to find 3rd highest salary of an employee from the employee table in sql?
Can I call a procedure inside a function?
Can we use ddl statements in stored procedure?
What are the different sql languages?
what are the authentication modes in sql server? How can it be changed? : Sql dba
How do you modify a column in sql?
How to select unique records from a table?
Is it important to partition hard disk?
What are the constraints available in sql?
what is the difference between union and union all? : Sql dba