>  기사  >  데이터 베이스  >  DB2创建表和Oracle的区别

DB2创建表和Oracle的区别

WBOY
WBOY원래의
2016-06-07 17:07:491344검색

在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

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.