数据库有两张表 build_info 和 build_info2,两张表单的结构是一样的,现在build_info表一个字段shop_money数据出错了,我需要把表2的这个字段数据更新到表一中,但是只需要更新用户test3在该字段的数据是零情况下的数据就可以,请问怎么写sql语句
4条回答
lambda-fk 2016-02-17 07:24关注只需要更新用户test3在该字段的数据是零情况
update build_info set shop_money=(select shop_money from build_info2 where build_info2.xxx=build_info.xxxx)
where build_info.user = build_info2.user and build_info.user = 'test3' and shop_money =0本回答被题主选为最佳回答 , 对您是否有帮助呢?解决评论 打赏 举报无用 1