Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

select department_id,salary from employees e 
where salary<(select trunc(avg(salary)) 
from employees where department_id=e.department_id;

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 sql partition function?

1292


how to shutdown mysql server? : Sql dba

1150


Why function is used in sql?

992


What is a composite primary key?

1144


What is a common use of group by in sql?

1100


what is union? : Sql dba

1084


What is varchar sql?

1209


how to create a new table in mysql? : Sql dba

1037


how many sql ddl commands are supported by 'mysql'? : Sql dba

1069


What does dml mean?

1045


What is latest version of sql?

1104


What is pivot in sql?

976


how to include numeric values in sql statements? : Sql dba

1149


What are the advantages of pl sql over sql?

1079


What does the acronym acid stand for in database management?

1093