Oracle怎么实现两张表日期相同的数据相加

2022-08-18 国际 152阅读
2014/5/0 ????
select a.time,a.amt_a+b.amt_b from
(select trunc(date,'yyyy/mm') time,sum(amt) amt_a from A group by trunc(date,'yyyy/mm')) a,
(select trunc(date,'yyyy/mm') time,sum(amt) amt_b from B group by trunc(date,'yyyy/mm')) b where a.time=b.time
时间那块的截取要测一下,可能要稍微修改下
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com