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

select e.eno,e.dno,e.sal
from emp_t e,
(select dno,avg(sal) avgsal from emp_t group by dno) b
where e.sal<b.avgsal and e.dno=b.dno
/

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an alias command?

1007


what is recursive stored procedure? : Sql dba

932


What is a constraint? Tell me about its various levels.

1085


What is audit logout in sql profiler?

979


What does partition by mean in sql?

911


What is difference between procedure and trigger?

922


Is primary key is clustered index?

942


how to shut down the server with 'mysqladmin'? : Sql dba

959


What does rownum mean in sql?

953


What is bulk compiling in pl/sql.?

1068


how to fetch alternate records from a table? : Sql dba

1053


How to add a column ‘salary’ to a table employee_details?

956


How do I access sql anywhere database?

922


Explain what is a view?

1000


how are mysql timestamps seen to a user? : Sql dba

1055