语句优化的问题!!!!

wanglaibing wanglaibing 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请问下面这条语句有什么办法可以优化下:

select code,descp,sum(money) sum_money
from ( select a.code,b.descp,sum(c.money*b.acount)money from table1 a,table2 b,table3 c
where a.code=b.code and b.descp=c.descp and .. group by a.code,b.descp
union all
select e.code,b.descp,sum(f.money*b.acount)money from table4 e,table5 f,table2 b
where e.code=b.code and b.descp=f.descp and .. group by e.code,b.descp
union all
select g.code,b.descp,sum(h.money*b.acount)money from table7 g,table8 h,table2 b
where g.code=b.code and b.descp=h.descp and .. group by e.code,b.descp
)group by code,descp
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
wanglaibing
Oracle 高级技术 3,499 成员 18,710 内容