财务数据统计
select code,patientsname,patientdepartmentname,amount,day from(
select code,patientsname,patientdepartmentname,amount ,day from tb_hos_outpatientcharges where feetype=1 union all
select recordcode as code,patientname as patientsname,recorddeptname as patientdepartmentname,money as amount,recordtime as day from tb_hos_in_hosfee where feetype=1
)
这个是查询两张表中记账的数据.现在要将同村镇的欠账钱数相加.插入统计表中..而且欠账钱数每天都会增加新的,怎么累加到统计表中?..求高手指教.