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

how to include character strings in sql statements? : Sql dba

1077


What is group by in sql?

1089


What is the purpose of using pl/sql?

1150


what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba

963


How to move files from one directory to another in pl sql?

1197


What are the different dml commands in sql?

1183


Explain cursor types?

1032


What is the difference among union, minus and intersect?

1005


Can we call a function containing dml statements in a select query?

988


What is varchar data type in sql?

1088


What is sqlerrm?

943


How do we accept inputs from user during runtime?

1071


How do I view output in sql developer?

1089


What has stored procedures in sql?

1070


If the application is running very slow? At what points you need to go about the database in order to improve the performance?

1004