SELECT
paymentMoney,
total,
contractType,
concat( round( paymentMoney / total * 100.00, 2 ), '%' ) percent
FROM
(
SELECT
sum( amount_money ) paymentMoney,
c.contract_type contractType
FROM
performance p
INNER JOIN contract c ON p.contract_no = c.contract_no
AND c.is_delete = '0'
WHERE
p.status <> '3'
AND p.performance_contents = 2
GROUP BY
c.contract_type
) t1
INNER JOIN (
SELECT
sum( amount_money ) total
FROM
performance p
INNER JOIN contract c ON p.contract_no = c.contract_no
AND c.is_delete = '0'
WHERE
p.status <>'3'
AND p.performance_contents = 2
) t2 ON 1 =1
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步