最近在做自己购物网站的数据迁移,一点一点记录一下MYSQL的相关语法:

将A表指定字段写入B表相应的字段:

INSERT INTO 目标表 (字段1, 字段2, ...) SELECT 字段1, 字段2, ... FROM 来源表;

insert into sxo_user (username,nickname,mobile,email,gender,province,city,address,add_time) select uname,name,mobile,email, sex,province,city,addr,regtime
from sdb_members