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 / ajit

select eno, dno, sal
from test
group by eno, dno, sal
having sal <any ( select avg(sal) from test )

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is exit statement?

740


what is text? : Sql dba

770


Is sql a dbms?

731


Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql

736


list out some tools through which we can draw e-r diagrams for mysql. : Sql dba

698






What are the operators in sql?

750


How do you add a column to a table?

767


Does postgresql run on the cloud?

798


What is dynamic query?

729


What is sql performance tuning?

645


How to run sql functions in pl/sql?

721


Explain the uses of control file.

773


Where is sql database stored?

681


what is primary key? : Sql dba

708


what are the differences between char and varchar? : Sql dba

748