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 there any restriction on the use of union in embedded sql?
What is oracle and pl sql?
Explain some predefined exceptions.
who introduced sql?
Why trigger is used in sql?
What is the usage of distinct keyword?
What are the ddl commands?
how to drop an existing table in mysql? : Sql dba
Explain the advantages and disadvantages of stored procedure?
Are stored procedures faster than queries?
Which are the different character-manipulation functions in sql?
Can a commit statement be executed as part of a trigger?
how to dump a table to a file with 'mysqldump'? : Sql dba
What view means?
What is the sql query to display the current date?