Mysql处理遗留数据样例

insert into user_pack_info(user_id,nick_name,bind_code,invite_code,phone,email,real_name,kyc_pass,create_time,update_time,create_time_stamp,update_time_stamp)
select id user_id,nick_name,bind_code,invite_code,phone,email,real_name,real_name_auth kyc_pass,created_at create_time,updated_at update_time,UNIX_TIMESTAMP(created_at)*1000  create_time_stamp,UNIX_TIMESTAMP(updated_at)*1000 update_time_stamp
from user;

update account_info a,(select * from history_saro) b
set a.num=a.num+b.num
where a.user_id=b.user_id and a.material_type=b.material_type;

猜你喜欢

转载自blog.csdn.net/a1773570500/article/details/125823272
今日推荐