SELECT * FROM xim UNION ALL select * FROM xin UNION ALL SELECT * FROM xit INTO CURSOR T
SELECT 项目11,单价11,SUM(总数量1) 总数量,SUM(总金额1) 总金额 FROM T GROUP BY 1,2
sele * from xim ;
union ;
sele 项目21 项目11,单价21 单价11,总数量2 总数量1,总金额2 总金额1 from xin;
union ;
sele 项目31 项目11,单价31 单价11,总数量3 总数量1,总金额3 总金额1 from xit into curs a1
SELECT 项目11,单价11,SUM(总数量1) 总数量,SUM(总金额1) 总金额 FROM a1 GROUP BY 项目11,单价11