标签:bom tom header ati tar service substr nbsp item
select * from V_OUTMO_HEADER where LOC_ID =‘2021‘ ; select * from V_OUTMO_HEADER where LOC_ID IN(‘2022‘,‘2023‘) ; SELECT * FROM V_OUTMO_DETAIL_MH WHERE PRODUCTIONORDID IN (SELECT PRODUCTIONORDID FROM V_OUTMO_HEADER where LOC_ID =‘2021‘); SELECT * FROM V_OUTMO_DETAIL_XG WHERE PRODUCTIONORDID IN (SELECT PRODUCTIONORDID FROM V_OUTMO_HEADER where LOC_ID IN(‘2022‘,‘2023‘)) ; select * from OUT_MO_WEBSERVICE; delete from OUT_MO_WEBSERVICE; --将2022、2023工厂的工单数据写入表中 INSERT INTO STG.TEMP_OUT_MO(PRODUCTIONORDID, SO_ID, SO_LINE_ID, PEGGED_MO_ID, ITEM, QTYORDERED, CREATION_DATE, LOC_ID, PLANNEDSTARTDATE, PLANNEDENDDATE, QTYUOM, CUSTOMER_ID, BOM_ID) SELECT PRODUCTIONORDID, LTRIM(SO_ID,‘0‘) AS SO_ID, SO_LINE_ID, PEGGED_MO_ID, ITEM, QTYORDERED, CREATION_DATE, LOC_ID, PLANNEDSTARTDATE, PLANNEDENDDATE, QTYUOM, CUSTOMER_ID, BOM_ID FROM STG.OUT_MO WHERE OUT_MO.LOC_ID in(‘2022‘,‘2023‘);
--2021 select * from v_out_mo; select * from v_out_mo_item_1 out_mo_item left join sap_marc on substr(out_mo_item.loc_ID, 0, 4)=sap_marc.werks and out_mo_item.item=sap_marc.matnr ; --2022\2023 select * from v_out_mo; SELECT * FROM V_OUT_MO_ITEM_2 out_mo_item ;
标签:bom tom header ati tar service substr nbsp item
原文地址:https://www.cnblogs.com/Snowfun/p/9429006.html