比如说我要复制表名为table1的表,SQL语句应该怎么写,复制后表名会怎样变化呢?谢谢2位我试过2位的了,在access的SQL语句中:select * into [新表名] from [旧表名] where 1=2; ---- 只复制表结构,不复制表内容select * into [新表名] from [旧表名]; ---- 既复制表结构,也复制表内容insert into [已创建好结构相似的新表名] select * from [旧表名]; 或者 select value1,value2…… into table2 from table1;
2 回答
呼啦一阵风
TA贡献1802条经验 获得超6个赞
1、既复制表结构也复制表内容的SQL语句:CREATE TABLE tab_new AS SELECT * FROM tab_old;
2、只复制表结构不复制表内容的SQL语句:CREATE TABLE tab_new AS SELECT * FROM tab_old WHERE 1=2;
3、不复制表结构,只复制内容的sql语句:insert into tab_new select * from tab_old;或者SELECT vale1, value2 into Table2 from Table1
添加回答
举报
0/150
提交
取消