table 1
id    name    type   
1       aa     01
2       bb     02
3       cc     03
4       dd     02table 2
type    typename    
01       eeee    
02       ffff   
03       gggg   
table 3
id      money1   money2
1        50       50
2        50       50     
3        50       50     
1        40       50     
4        60       50     
table 4
id      money3   money4
1        50       50
2        50       30     
3        50       50     
1        30       50     
4        60       50 
我想得到table  中的各项关联的 table3  和table4中的 sum(money1) sum(money1) sum(money1) sum(money1) type    typename     sum(money1)   sum(money2)   sum(money3)   sum(money4)  
01         eee           90            100          80              100
02         fff           110           100         110              100
03         ggg           100           100         100              100