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 drivers in mysql? : Sql dba
Explain the purpose of %type and %rowtype data types?
What are local and global variables and their differences?
What has stored procedures in sql and how we can use it?
write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba
what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba
Can we call stored procedure in function?
Is postgresql a server?
How do you know if a relationship is 2nf?
how to write date and time literals? : Sql dba
Where is pl sql used?
Can we join same table in sql?
what is unique key constraint? : Sql dba
What is the difference between syntax error and runtime error?
What is trigger in sql and its types?