首页 > 代码库 > 多表关联 update

多表关联 update

UPDATE t_invests
INNER JOIN t_user_coupons ON t_invests.user_coupon_id = t_user_coupons.id
SET t_invests.virtual_product_id = t_user_coupons.virtual_product_id
WHERE
    t_user_coupons.virtual_product_id > 0;

 

多表关联 update