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 ‘系列‘;