您的位置:首页 > 数据库 > MySQL

mysql中的select into 与insert into语句用于备份数据

2016-10-20 15:08 417 查看
sql中的select *into new_table from old_table和insert into new_table (id1,name1)select (id,name) from old_table 用于将一个表中的数据备份到另一个表中。

不过,mysql不支持select *into 语句,可以用

另一种方式代替:

create table table2 (select *from table1)

select *into语句自动创建新表,insert into语句是要提前创建好新表.

相关链接1

相关链接2

相关链接3

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: