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

select * from emp e where sal<
(select avg(sal) from emp where deptno=e.deptno)
order by deptno

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is union, minus and interact commands? : Sql dba

1190


Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

1211


Enlist the advantages of sql.

1006


What does bitemporal mean?

1074


What are the types of variable use in pl sql?

1087


How to add new employee details in an employee_details table with the following details

1091


Can function return multiple values in sql?

1062


What is a recursive stored procedure?

1188


how to concatenate two character strings? : Sql dba

1107


Explain how exception handling is done in advance pl/sql?

1001


What are different categories of sql commands?

1135


Does oracle roll back the transaction on an error?

1022


I need a function for a train ticket reservation please answer it thanks in advance

1033


What is the usage of when clause in trigger?

1060


What are the key differences between SQL and PL SQL?

1220