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 an alias command?
what is recursive stored procedure? : Sql dba
What is a constraint? Tell me about its various levels.
What is audit logout in sql profiler?
What does partition by mean in sql?
What is difference between procedure and trigger?
Is primary key is clustered index?
how to shut down the server with 'mysqladmin'? : Sql dba
What does rownum mean in sql?
What is bulk compiling in pl/sql.?
how to fetch alternate records from a table? : Sql dba
How to add a column ‘salary’ to a table employee_details?
How do I access sql anywhere database?
Explain what is a view?
how are mysql timestamps seen to a user? : Sql dba