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

Is sql developer case sensitive?

532


what is a trigger in mysql? Define different types of trigger. : Sql dba

562


tell us something about heap tables. : Sql dba

611


Why we use triggers in mysql?

566


Does postgresql run on the cloud?

604






What is cartesian join in sql?

567


What is a native sql query?

507


How do you identify a primary key?

641


What are the methods of filing?

526


what is the difference between join and union? : Sql dba

558


what is online transaction processing (oltp)? : Sql dba

537


What is group by in sql?

556


Show how functions and procedures are called in a pl/sql block.

597


What is data definition language?

630


What does the hierarchical profiler does?

581