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 a Mapplet?

640


what is a composite primary key ? : Sql dba

576


Mention what plvcmt and plvrb does in pl/sql?

632


What is primary key sql?

536


How many types of indexes are there in sql?

535






Write a sql select query that only returns each name only once from a table?

562


What is a system versioned table?

526


what is top in tsql? : Transact sql

537


is it possible to pass an object or table to a procedure as an argument?

563


Define commit?

544


Explain unique key in sql.

558


What is rank () in sql?

529


What is the benefit of foreign key?

522


What is an inner join sql?

542


What are schema-level triggers?

572