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
What are analytic functions in sql?
What are the ways on commenting in a pl/sql code?
Why are aggregate functions called so?
What is clustered index in sql?
What is meant by truncate in sql?
Can we join tables without foreign key?
How to display the records between two range in Oracle SQL Plus?
Are subqueries better than joins?
What is the advantage of index in sql?
What is a stored procedure in sql with example?
What are the string functions in sql?
How do you clear the screen in sql?
what are the advantages and disadvantages of views in a database? : Sql dba
How many row comparison operators are used while working with a subquery?
Show the two pl/sql cursor exceptions.