【问题描述】
更新行业会员特性表里面的宝宝姓名和会员档案里面的姓名一致?
【问题答案】
请先备份好数据库再执行以下语句:
use isszm店
delete t_rm_vip_motherhood_identity
–插入会员ID
INSERT INTO t_rm_vip_motherhood_identity (card_id )
select t_rm_vip_info.card_id from t_rm_vip_info where card_id not in ( select card_id from t_rm_vip_motherhood_identity)
–更改会员姓名
update t_rm_vip_motherhood_identity
set baby_name = t_rm_vip_info.vip_name
from t_rm_vip_info,t_rm_vip_motherhood_identity
where t_rm_vip_info.card_id = t_rm_vip_motherhood_identity.card_id