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
How do we use distinct statement? What is its use?
Difference between truncate, delete and drop commands?
Explain how to use transactions efficiently : transact sql
Is left join inner or outer?
How many times can we commit in a loop?
What is the usage of distinct keyword?
How is a process of pl/sql compiled?
What are the advantages of pl sql?
What is a temp table?
What is the command used to fetch the first 5 characters of a string?
What is mutating sql table?
How do I run a sql query?
What is secondary key?
What is pl/sql table? Why it is used?
How to fetch alternate records from a table?