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

select * from emp group by deptno having sal < avg(sal)

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to make a copy values from one column to another in sql?

767


How do I run a program in pl sql?

699


What is the use of nvl function?

864


What is a behavioral trigger?

694


What is auto increment feature in sql?

819






Why truncate is used in sql?

720


How long it takes to learn pl sql?

723


What do you understand by pl/sql cursors?

739


Can sql function call stored procedure?

738


What are stuff and replace function?

768


how to convert numeric values to character strings? : Sql dba

778


How can we link a sql database to an existing android app?

728


How do I pipe the output of one isql to another?

722


Can we create foreign key without primary key?

705


What is sql clause?

740