BOM 树型查询含查找上级及顶级产品--新建一个表,将结果插入到表里面 create table CUX_BOM_ID (KINDID number(20),kindname varchar(200),FATHERID number(20),ITEMD number(20))--新建一个存储过程,并将执行结果放入到CUX_BOM_ID 里面ent1, mtl
description from bom_bill_of_materials a, MTL_SYSTEM_ITEMS_B mtl where a
ASSEMBLY_ITEM_ID = mtl
inventory_item_id and a
ORGANIZATION_ID = mtl
organization_id and mtl
organization_id = 101 ) a where not exists (select * from (select mtl2
segment1, mtl2
description from bom_inventory_components bom, MTL_SYSTEM_ITEMS_B mtl2 where bom
COMPONENT_ITEM_ID = mtl2
inventory_item_id and mtl2
organization_id = 101 ) b where a
segment1 = b
segment1) and rownum