版權聲明:本文為博主原創文章,未經博主允許不得轉載。
create or replace view oes_material_series_ref as
select t.productgroup, o.idnrk materialcode, t.seriescode
from oes_park_priority t
inner join oms_hm_mtl_general_view v
on t.materialcode = v.material_code
left join oms_modelbom_noderela o
on t.materialcode = o.matnr
where 1 = 1
and v.primary_uom = 'TAO'
group by t.productgroup, t.materialcode, o.idnrk, t.seriescode
union
select t.productgroup, t.materialcode, t.seriescode
from oes_park_priority t
inner join oms_hm_mtl_general_view v
on t.materialcode = v.material_code
group by t.productgroup, t.materialcode, t.seriescode;
comment on column OES_MATERIAL_SERIES_REF.PRODUCTGROUP is '產品組';
comment on column OES_MATERIAL_SERIES_REF.MATERIALCODE is '物料號';
comment on column OES_MATERIAL_SERIES_REF.SERIESCODE is '系列';
select t.productgroup, o.idnrk materialcode, t.seriescode
from oes_park_priority t
inner join oms_hm_mtl_general_view v
on t.materialcode = v.material_code
left join oms_modelbom_noderela o
on t.materialcode = o.matnr
where 1 = 1
and v.primary_uom = 'TAO'
group by t.productgroup, t.materialcode, o.idnrk, t.seriescode
union
select t.productgroup, t.materialcode, t.seriescode
from oes_park_priority t
inner join oms_hm_mtl_general_view v
on t.materialcode = v.material_code
group by t.productgroup, t.materialcode, t.seriescode;
comment on column OES_MATERIAL_SERIES_REF.PRODUCTGROUP is '產品組';
comment on column OES_MATERIAL_SERIES_REF.MATERIALCODE is '物料號';
comment on column OES_MATERIAL_SERIES_REF.SERIESCODE is '系列';