ORACLE 11G multi-column table joins update


-- ORACLE 11G  表联合更新多列  
update apps.SGD_ACTUAL_WIP_COST cst
set (cst.ITEM_ID,cst.WIP_ENTITY_ID,cst.STATUS_TYPE,
cst.START_QUANTITY,cst.NET_QUANTITY,
cst.QUANTITY_COMPLETED,cst.DATE_RELEASED,cst.DATE_CLOSED ) =
( select wip.primary_item_id as ITEM_ID,wip.WIP_ENTITY_ID,wip.STATUS_TYPE,
wip.START_QUANTITY,wip.NET_QUANTITY,
wip.QUANTITY_COMPLETED,wip.DATE_RELEASED,wip.DATE_CLOSED
from apps.wip_discrete_jobs_V wip
where wip.wip_entity_name =cst.wip_entity_name )
where PERIOD= '1704'
and CST.WIP_ENTITY_NAME IS NOT NULL
and cst.wip_entity_name ='DD32DI022' -- 'DD421I061'

 

MSSQL:

UPDATE 1 alias

SET alias 1.COL1 = alias 2.COL20,

Alias ​​1.COL2 = alias 2.COL21,

Alias ​​Alias ​​2.COL22 1.COL3 =

Alias ​​FROM table 1, table 2 Alias ​​2

WHERE alias 1.ID = alias 2.ID and conditions

 

Guess you like

Origin www.cnblogs.com/samrv/p/11418746.html