mysql表之间数据转移


//把User表中相关字段的记录并入到UserAdditionalInfo表中
insert tbl_user_additional_info
(user_id,country,address,postal_code,phone,edu_background)
select 
user_id,country,address,postal_code,phone,edu_background
from tbl_user where user_id not in(select user_id from tbl_user_additional_info);

//更改User表的结构
alter table tbl_user 
drop user_id,
drop country,
drop address,
drop postal_code,
drop phone,
drop edu_background;

##############################


你可能感兴趣的:(数据结构,mysql)