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
How do you explain an index number?
Mention what does the hierarchical profiler does?
What operators deal with null?
What is sql key?
Can we delete column in sql?
what is cursor and its type, what is ref cursor write a syntax to pass ref cursor into procedure out fucntion and call the procedure
what are the advantages of using stored procedures? : Sql dba
Are sql connections encrypted?
Differentiate between syntax and runtime errors.
How do I debug a stored procedure?
Why having clause is used in sql?
How do I view tables in sql developer?
Is record in pl sql?
what is the difference between $message and $$message? : Sql dba
Do foreign keys improve performance?