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 / subbu
select e.eno,e.dno,e.sal
from emp_t e,
(select dno,avg(sal) avgsal from emp_t group by dno) b
where e.sal<b.avgsal and e.dno=b.dno
/
Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
What is flag in sql?
Why do we use view in sql?
What is pl/sql table? Why is it used?
What is constant in pl sql?
What is the use of index in sql?
How to handle bulk data?
explain access control lists. : Sql dba
Is there any restriction on the use of union in embedded sql?
How can one get sql*loader to commit only at the end of the load file? : aql loader
Is it possible to sort a column using a column alias?
What schema means?
What is meant by cursor in sql?
How to write a query to show the details of a student from students table whose
Determine if oracle date is on a weekend?
Is mariadb nosql?