1. 新增一个表,通过另一个表的结构和数据 create table XTHAME.tab1 as select * from DSKNOW.COMBDVERSION 2. 如果表存在: insert into tab1 select * from tab2; 3.同一个表中,将A字段的指赋给B字段: update table_name set B = A; 4. 将一个表的字段数据插入到另一个表的字段数据中 insert into XTHAME.tab1(pk_bdversion,vbd…
原文地址:https://www.cnblogs.com/linjiqin/archive/2013/06/24/3152667.html with as语法–针对一个别名with tmp as (select * from tb_name) –针对多个别名with tmp as (select * from tb_name), tmp2 as (select * from tb_name2), tmp3 as (select * from tb_name3), … 1 2 3…
1. 新增一个表,通过另一个表的结构和数据 create table XTHAME.tab1 as select * from DSKNOW.COMBDVERSION 2. 如果表存在: insert into tab1 select * from tab2; 3.同一个表中,将A字段的指赋给B字段: update table_name set B = A; 4. 将一个表的字段数据插入到另一个表的字段数据中 insert into XTHAME.tab1(pk_bdversion,vbdco…