mysql中。第一种:先将金额按照一定要求 原来的amount_money, case when rcd.material_code ='9801H00X' and expense_item ='收入' then rcd.amount_money-rcd.quantity*1.1 when rcd.material_code ='9801H00X' and expense_item ='成本' then rcd.amount_money-rcd.quantity*0.5257 。... end as 新_amount_money 拆分。拆分之后。求和这个sum(xin_amount_money) 第二种。sum(原来_amount_money)-sum(quantity)**0.5257 这2个结果为啥对不上? |