oracle 在已有表新增列內批量加數據

建立每列隨機值的語句dom

create table TEST_ZHAA01A_03 as
select rownum as id,
to_char(sysdate + rownum/24/3600, 'yyyy-mm-dd hh24:mi:ss') as inc_datetime,
trunc(dbms_random.value(0, 999999999999)) as random_id,
dbms_random.string('x', 20) random_string
from dual
connect by level <= 25036;

將A表與B表合併,而後創建C表的語句
create table TEST_ZHAA01A_03 as (select * from
(select rownum rn1, TEST_ZHAA01A_01.* from TEST_ZHAA01A_01),
(select rownum rn2, TEST_ZHAA01A_03.* from TEST_ZHAA01A_03)
where rn1 = rn2);string

 

將A表數據寫入B表table

insert into TEST_ZHAA01B_01(ZHAA01B010,ZHAA01B020,ZHAA01B030,ZHAA01B070,ZHAA01B110) date

select ZHAA01A010,ZHAA01A010,ZHAA01A025,ZHAA01A040,ZHAA01A050 from TEST_ZHAA01A_01;select

 

insert into TEST_ZHAA01B_01(ZHAA01B010,ZHAA01B020,ZHAA01B030,ZHAA01B070,ZHAA01B110) 
select ZHAA01B010,ZHAA01A010,ZHAA01A025,ZHAA01A040,ZHAA01A050 from TABLE1;im

 

更新A表中時間屬性字段語句
update TEST_ZHAA01B set ZHAA01B050=to_date('2017-07-19 12:00:00','yyyy-mm-dd hh24:mi:ss')數據

相關文章
相關標籤/搜索