select into from与insert into select区别

来源:互联网 发布:html5音乐网站源码 编辑:程序博客网 时间:2024/05/04 00:45

select into from与insert into select区别 


两者都是复制表的语句,但还是有一定的区别的。。

1. select * into table2 from table1;
2. insert into table2 select * from table1;

语句1中的table2是不能已经建立的,语句执行的时候会自动建立表table2,如果已经存在表table2,系统会提示表已存在 。
而语句2中的table2则必须已经存在,否则会提示表不存在~