文章詳情頁
DB2 SELECT語句高級(jí)用法
瀏覽:131日期:2023-03-24 09:22:32
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;
標(biāo)簽:
DB2
相關(guān)文章:
1. 執(zhí)行DB2的命令有哪些方式?2. 使用SQL Server連接服務(wù)器訪問DB2 Server3. 分析DB2活動(dòng)日志滿的原因及解決DB2日志滿方法與避免方案4. DB2比較常用與實(shí)用sql語句總結(jié)5. DB2的高可用性和災(zāi)難恢復(fù)概述6. 淺談MySQL之select優(yōu)化方案7. Db2數(shù)據(jù)庫中常見的堵塞問題分析與處理方法8. 解決db2事務(wù)日志已滿及日志磁盤空間已滿問題辦法詳解9. DB2中REVERSE函數(shù)的實(shí)現(xiàn)方法10. Mybatis之Select Count(*)的獲取返回int的值操作
排行榜
