Select YEAR(销售_日期) As 日期_年, month(销售_日期) As 日期_月, sum(销售_母猪), sum(销售_公猪), sum(销售_肉猪), sum(补贴项目), sum(其他收入) f rom
(Select 销售_日期, 销售_金额 As 销售_母猪 f rom {母猪基本信息} u nion all
Select 销售_日期, 销售_金额 As 销售_公猪 f rom {公猪信息} u nion all
Select 销售_日期, 销售_金额 As 销售_肉猪 f rom {肉猪信息} u nion all
Select 日期, 金额 As 补贴项目 f rom {补贴项目} u nion all
Select 日期, 金额 As 其他收入 f rom {其他收入})
As a group by year(销售_日期) ,month(销售_日期) order by year(销售_日期) ,month(销售_日期)
老师,我写得呕心沥血了,麻烦你在帮我改一下