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 a Mapplet?
what is a composite primary key ? : Sql dba
Mention what plvcmt and plvrb does in pl/sql?
What is primary key sql?
How many types of indexes are there in sql?
Write a sql select query that only returns each name only once from a table?
What is a system versioned table?
what is top in tsql? : Transact sql
is it possible to pass an object or table to a procedure as an argument?
Define commit?
Explain unique key in sql.
What is rank () in sql?
What is the benefit of foreign key?
What is an inner join sql?
What are schema-level triggers?