Home  >  Article  >  Database  >  DB2创建表和Oracle的区别

DB2创建表和Oracle的区别

WBOY
WBOYOriginal
2016-06-07 17:07:491344browse

在db2中如果想创建和已知表表结构类似的表,可以使用:(1)create table a as select * from b where 1lt;gt;1; ----仅创建表

在db2中如果想创建和已知表表结构类似的表,可以使用:

(1)create table a as select * from b where 11;   ----仅创建表,,不导入数据。

(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 11   ----创建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;

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn