select a,sys_guid() as b from mytable
sys_guid() 是生成帶分隔符(-)的GUID的自定義函式
查詢B表的內容插入A表,MY_ID是A表的主鍵不可為空,因此需要B查詢出來的資料增加一列並且賦值插入A
insert into A (plan_id,ship_id,MY_ID)
select plan_id,ship_id,sys_guid() as myMonthID from B
select a,sys_guid() as b from mytable
sys_guid() 是生成帶分隔符(-)的GUID的自定義函式
查詢B表的內容插入A表,MY_ID是A表的主鍵不可為空,因此需要B查詢出來的資料增加一列並且賦值插入A
insert into A (plan_id,ship_id,MY_ID)
select plan_id,ship_id,sys_guid() as myMonthID from B