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
Define join and name different types of joins?
Why is sql important?
Does oracle use sql?
Do we need to rebuild index after truncate?
Can you call pl/sql package functions from within a fast formula?
Define sql delete statement.
How do you update f as m and m as f from the below table testtable?
Differentiate pl/sql and sql?
How can I tell if sql is running?
What is materialized view. What are different methods of refresh?
what is sql in mysql? : Sql dba
What is difference between group by and partition by?
What is Histogram?
Give the order of sql select?
What is the purpose of my sql?