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 convert numeric values to character strings? : Sql dba

1039


Can a select statement fire a trigger?

1100


in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.

2024


How can a pl sql block be executed?

893


What are analytic functions in sql?

974


how to check myisam tables for errors? : Sql dba

1262


Where are my tempfiles, I don't see them in v$datafile or dba_data_file?

946


what is sub-query? : Transact sql

1047


what are ddl statements in mysql? : Sql dba

1114


What is asqueryable?

905


How to display Row Number with Records in Oracle SQL Plus?

993


In what condition is it good to disable a trigger?

972


Write the command to remove all players named sachin from the players table.

1124


What is the least restrictive isolation level? : Transact sql

1001


How do I find duplicates in sql?

879