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 / praveen
select * from emp e where sal<
(select avg(sal) from emp where deptno=e.deptno)
order by deptno
| Is This Answer Correct ? | 20 Yes | 2 No |
Post New Answer View All Answers
How do I truncate a word?
What is a database? Explain
what is a materialized view? : Sql dba
What is trigger in sql?
What is user in sql?
What is data manipulation language?
What is foreign key sql?
What are views in sql?
How to install oracle sql developer?
Is grant a ddl statement?
What is an exception in PL/SQL? What are the two types of exceptions?
What are the various levels of constraints?
Can we debug stored procedure?
What does varchar include?
What are the advantages of normalization?