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
Write a query to find the names of users that begin with "um" in sql?
explain the difference between bool, tinyint and bit. : Sql dba
How do I remove duplicates in two columns?
How do I run a pl sql program?
Which sql statement is used to return only different values?
What does a pl/sql package consist of?
what is dbms? : Sql dba
Write a sql query to find the names of employees that begin with ‘a’?
How many sql statements are used?
Is sql scripting language?
What is sqlservr exe?
Define concurrency control. : Transact sql
What are basic techniques of indexing?
how to convert character strings to numeric values? : Sql dba
What is rownum?