mysql db2 建表_DB2创建表和Oracle的区别
在db2中如果想创建和已知表表结构类似的表,可以使用:(1)create table a as select * from b where 1lt;gt;1; ----仅创建表在db2中如果想创建和已知表表结构类似的表,可以使用:(1)create table a as select * from b where 1<>1;----仅创建表,,不导入数据。(2)create ta...
在db2中如果想创建和已知表表结构类似的表,可以使用:(1)create table a as select * from b where 1lt;gt;1; ----仅创建表
在db2中如果想创建和已知表表结构类似的表,可以使用:
(1)create table a as select * from b where 1<>1; ----仅创建表,,不导入数据。
(2)create table a as select * from b ----创建表a,连同b中的数据也要copy到要创建的a表中去。
(3)create table a as select a,b,c,d,e from b where 1<>1 ----创建a表,表结构和b表中的a,b,c,d,e这5个列一致,并且不包含表数据。
如果在db2中要完成类似的任务,可以使用如下语句执行。
(1)create table a like b;
(2)create table a like b;
insert into a (select * from b);
(3)create table a as (select a,b,c,d,e from b) definition only;


本文原创发布php中文网,转载请注明出处,感谢您的尊重!
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)