--只是建立ta表,与emp表结构相同,并不添加数据
--这种构造与现存表相同结构的表,是不会将comment带过来的
create table ta as select * from scott.emp where 1=0;
--建立tb表,结构与dept结构相同,将dept表中的数据导入其中
--这种构造与现存表相同结构的表,是不会将comment带过来的:
create table tb as select * from scott.dept where 1=1;
本文介绍了如何使用SQL语句创建一个空表并保持与原表相同的结构,同时演示了如何将现有表的数据导入到新建的表中。通过具体实例展示了两种情况下的SQL语法。
--只是建立ta表,与emp表结构相同,并不添加数据
--这种构造与现存表相同结构的表,是不会将comment带过来的
create table ta as select * from scott.emp where 1=0;
--建立tb表,结构与dept结构相同,将dept表中的数据导入其中
--这种构造与现存表相同结构的表,是不会将comment带过来的:
create table tb as select * from scott.dept where 1=1;
4041
533

被折叠的 条评论
为什么被折叠?