diff --git a/%E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md b/%E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md index af2b9f0..7059f40 100644 --- a/%E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md +++ b/%E6%B2%B3%E5%8C%97%E7%89%88%E4%B8%8A%E7%BA%BFSQL.md @@ -20,12 +20,12 @@ VALUES ### 修复数据,成长值不一致,以wx_c_user表数据为准 ``` -UPDATE wx_c_user_basic_info cub SET cub.poins=(SELECT cu.score FROM wx_c_user cu WHERE cu.id=cub.id ),update_date=now(); +update wx_c_user_basic_info cub,wx_c_user c set cub.poins=c.score,cub.update_date=now() where c.id=cub.id ``` ### 修复数据,积分不一致,以wx_c_user表数据为准 ``` -UPDATE wx_c_user_basic_info cub SET cub.credit=(SELECT cu.credit FROM wx_c_user cu WHERE cu.id=cub.id ),update_date=now(); +update wx_c_user_basic_info cub,wx_c_user c set cub.credit=c.credit,cub.update_date=now() where c.id=cub.id ``` ### 修复数据 券库存不一致