Posted on 2010-03-18 00:07
Prayer 閱讀(226)
評論(0) 編輯 收藏 引用 所屬分類:
DB2
一般的CREATE TABLE 就不說了,就說說三種高級的:
1、創(chuàng)建結(jié)果表
create table new_table_name as
(select * from table_name) definition only;
2、創(chuàng)建物化查詢表(MQT)
create table new_table_name as
(select * from table_name)
data initially deferred refresh deferred;
refresh table new_table_name;
注意:物化表實(shí)際上類似一個(gè)查詢,沒有真正形成表,類型顯示為Query。但是完全可以當(dāng)表來用。
3、復(fù)制表結(jié)構(gòu)
create table new_table_name like table_name;