SQL 求和语句

 我来答
化凡硕怡和
2019-01-20 · TA获得超过3731个赞
知道小有建树答主
回答量:3176
采纳率:24%
帮助的人:173万
展开全部
select
sum(*)
from
(SELECT
SUM(zy_detail_charge.charge_amount)
FROM
zy_detail_charge
where
zy_detail_charge.charge_code
in
(select
fee_code
from
or_level
where
or_level
=
'xt'
and
flag
=
'410')
and
data_month
='2010-08'
union
all
SELECT
SUM(mz_charge_detail.quantity)
from
mz_charge_detail
where
mz_charge_detail.charge_item_code
in
(select
fee_code
from
or_level
where
or_level
=
'xt'
and
flag
=
'410'))
昂禾别原
2019-05-01 · TA获得超过3614个赞
知道大有可为答主
回答量:3144
采纳率:28%
帮助的人:198万
展开全部
SELECT
SUM(zy_detail_charge.charge_amount)
,SUM(mz_charge_detail.quantity)
FROM
zy_detail_charge
,mz_charge_detail
where
zy_detail_charge.charge_code
in
(select
fee_code
from
or_level
where
or_level
=
'xt'
and
flag
=
'410')
and
data_month
='2010-08'
and
zy_detail_charge.charge_code=mz_charge_detail.charge_item_code
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式