您好,欢迎访问四川鑫光豪耀机电有限公司!

咨询热线:

18980820575
✕

营山发电机维修,营山柴油发电机维修,品牌发电机维修,发电机维修服务公司

DB2数据库SELECT语句的三种高级用法

SELECT语句是数据库查询的重要语句,这里介绍三种SELECT语句的高级用法。

1、创建结果表

 
 
 
  1. create table new_table_name as   
  2.  
  3. (select * from table_name) definition only; 

2、创建物化查询表(MQT)

 
 
 
  1. create table new_table_name as   
  2.  
  3. (select * from table_name)   
  4.  
  5. data initially deferred refresh deferred;   
  6.  
  7. refresh table new_table_name;  

注意:物化表SELECT语句类似一个查询,没有真正形成表,类型显示为Query。但它完全可以当表来用。

3、复制表结构

 
 
 
  1. create table new_table_name like table_name; 
友情链接 :