DB2 SELECT語句高級(jí)用法
更新時(shí)間:2010年06月25日 19:03:14 作者:
DB2 SELECT語句高級(jí)用法,學(xué)習(xí)db2的朋友可以參考下。
1、創(chuàng)建結(jié)果表
create table new_table_nameas
( select * from table_name ) definitiononly;
create table new_table_nameas
( select * from table_name ) definitiononly;
2、創(chuàng)建物化查詢表(MQT)
create table new_table_nameas
( select * from table_name )
datainitially deferred refresh deferred;
refresh table new_table_name;
注意:物化表類似一個(gè)查詢,沒有真正形成表,類型顯示為Query。但它完全可以當(dāng)表來用。
3、復(fù)制表結(jié)構(gòu)
create table new_table_name like table_name;
相關(guān)文章
DB2 UDB V8.1管理學(xué)習(xí)筆記(二)
DB2 UDB V8.1管理學(xué)習(xí)筆記(二)...2007-03-03創(chuàng)建一個(gè)空的IBM DB2 ECO數(shù)據(jù)庫的方法
2008-01-01DB2獲取當(dāng)前用戶表、字段、索引等詳細(xì)信息
這篇文章主要介紹了DB2獲取當(dāng)前用戶表、字段、索引等詳細(xì)信息的sql,需要的朋友可以參考下2014-07-07