我可以把它合二为一吗?
UPDATE 1_packages k
SET
rrp = (SELECT
SUM(u.quantity * p.rrp) * (sum(p.price_each <> 0 and p.rrp = 0) = 0)
FROM
1_packages_plu u
INNER JOIN
1_products p ON u.fk_products_id = p.id
WHERE
fk_packages_id = k.id)
;
UPDATE 1_packages k
SET
rrp_inc = (SELECT
SUM(u.quantity * p.rrp_inc) * (sum(p.price_each <> 0 and p.rrp_inc = 0) = 0)
FROM
1_packages_plu u
INNER JOIN
1_products p ON u.fk_products_id = p.id
WHERE
fk_packages_id = k.id)
;