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


Please Help Members By Posting Answers For Below Questions

What is flag in sql?

539


Why do we use view in sql?

532


What is pl/sql table? Why is it used?

559


What is constant in pl sql?

515


What is the use of index in sql?

553






How to handle bulk data?

889


explain access control lists. : Sql dba

555


Is there any restriction on the use of union in embedded sql?

669


How can one get sql*loader to commit only at the end of the load file? : aql loader

563


Is it possible to sort a column using a column alias?

601


What schema means?

521


What is meant by cursor in sql?

543


How to write a query to show the details of a student from students table whose

540


Determine if oracle date is on a weekend?

554


Is mariadb nosql?

581