|
楼主 |
发表于 2016-1-16 01:21:38
|
显示全部楼层
非常感谢,虽然在你说之前,我已经找到了另外的方法获取到物料id的对应物料编码和名称,但还是谢谢帮忙,顺便把我的方法也分享出来
select * from ufdata_666_2013..v_bom_parent_rpt ---BOM母件资料
select * from ufdata_666_2013..v_bom_opcomponent_rpt ---BOM子件资料
select * from ufdata_666_2013..v_bom_bom_rpt ---BOM资料
select bomid as 'bom自增id'
, bomtype as 'bom类型'
, Status as 'bom状态'
from ufdata_666_2013..v_bom_bom_rpt where status='3'
select * from ufdata_666_2013..v_bom_parent_rpt
select
a.bomid as 'bom自增id'
, a.bomtype as 'bom类型'
--, a.Status as 'bom状态'
, b.parentid as '母件物料Id'
, b.InvCode as '物料编码'
, d.cInvname as '母件物料名称'
, c.componentid as '子件物料Id'
, c.InvCode as '子件物料编码'
--, f.cInvname as '子件物料名称'
, c.SortSeq as '行号'
, c.BaseQtyN as '基本用量-分子'
, c.BaseQtyD as '基本用量-分母'
--, c.ByproductFlag as '产出品'
from ufdata_666_2013..v_bom_bom_rpt a
left join ufdata_666_2013..v_bom_parent_rpt b on a.bomid=b.bomid
left join ufdata_666_2013..v_bom_opcomponent_rpt c on a.bomid=b.bomid
left join ufdata_666_2013..Inventory d on b.InvCode=d.cInvCode
--left join ufdata_666_2013..bas_part f on c.InvCode=f.InvCode
---where a.status='3' and a.bomid='1000000037'
where a.status='3' and a.bomid='1000000037' and c.componentid='2462'
我是通过视图做的, 我看到对应表视图上有这个字段;
|
|