mysql–把A表的数据导入到B表,B表存在

大刘sir 0



把A表的数据导入到B表,B表存在

insert into B SELECT * FROM A;
–创建B表
create table students_B(
scode int,
sname char(10),
saddress varchar(50)
)ENGINE=INNODB DEFAULT CHARSET=UTF8;

insert into students_B
SELECT scode , sname, saddress from students where scode<=5;

select * from students_B;

发表评论

邮箱地址不会被公开。 必填项已用*标注