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
Can you have more than one trigger on a table?
What are the different types of functions in sql?
What is data type in sql?
Is inner join faster than left join?
How to call shell script from pl sql procedure?
What is the usage of distinct keyword?
what is a composite key ? : Sql dba
List and explain the different types of join clauses supported in ansi-standard sql?
What are its different types of dbms?
what are myisam tables? : Sql dba
What is raid? How does it help storage of databases?
How can you load microsoft excel data into oracle? : aql loader
How would you pass hints to the sql processor?
how to rename an existing table in mysql? : Sql dba
What is Difference Between Unique and Primary Key Constraints?