mysql 多表更新

xiaoxiao2021-02-28  100

UPDATE yi_user a set  freezeamt=freezeamt- ( select sum(fee) from bp_drawout b where  b.srcType='Y' and b.dstatus=4 and b.srcid=a.yuid GROUP BY b.srcid ), amt=amt+ ( select sum(fee) from bp_drawout b where  b.srcType='Y' and b.dstatus=4 and b.srcid=a.yuid GROUP BY b.srcid ) where  a.yuid in ( select b.srcid from bp_drawout b where  b.srcType='Y' and b.dstatus=4 GROUP BY b.srcid ) 
转载请注明原文地址: https://www.6miu.com/read-44322.html

最新回复(0)