i have a table
eno dno sal
1 10 200
2 10 150
3 10 100
4 20 75
5 20 100
i want to get sal which is less than the avg sal of thri dept.
eno dno sal
2 10 150
3 10 100
4 20 75
Answer Posted / mohan
SELECT dno,sal
FROM EMP
WHERE sal>ANY(SELECT AVG(sal)
FROM emp
GROUP BY dno)
ORDER BY dno;
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Is postgresql a server?
what tools available for managing mysql server? : Sql dba
What can I use instead of union in sql?
What are the steps for performance tuning.
What is scalar and vector?
How sql query is executed?
What is the most restrictive isolation level? : Transact sql
Is drop table faster than truncate?
How many columns should be in an index?
Which join is like an inner join?
explain mysql aggregate functions. : Sql dba
What are % type and % rowtype?
what are set operators in sql? : Sql dba
How to write html code in pl sql?
What is an exception in PL/SQL? What are the two types of exceptions?