create table test_temp2 as select * from test_temp where 1=0;
上面加了判断1=0 那么就没有插入数据。
不加判断的话,就也复制了数据
在mysql中试了一下,上面的语法也支持,但是区别是无法用drop table 删除掉有数据的表,在oracle中则可以。
只能先truncate table test_temp2,然后drop table test_temp2。
create table test_temp2 as select * from test_temp where 1=0;
上面加了判断1=0 那么就没有插入数据。
不加判断的话,就也复制了数据
在mysql中试了一下,上面的语法也支持,但是区别是无法用drop table 删除掉有数据的表,在oracle中则可以。
只能先truncate table test_temp2,然后drop table test_temp2。