查询某个原物料下的子组件:

select level,
       t.*
  from (select items1.segment1 segment1_m,
               items1.inventory_item_id m_id,
               items1.description description_m,
               materials.bill_sequence_id,
               components.item_num,
               components.operation_seq_num,
               components.component_item_id sub_id,
               items2.segment1 segment1_sub,
               items2.description description_sub,
               components.component_quantity,
               components.EFFECTIVITY_DATE,
               components.DISABLE_DATE
          from bom_bill_of_materials    materials,
               mtl_system_items_b       items1,
               bom_inventory_components components,
               mtl_system_items_b       items2
         where materials.assembly_item_id = items1.inventory_item_id
           and materials.bill_sequence_id = components.bill_sequence_id
           and components.component_item_id = items2.inventory_item_id
           and items2.organization_id = 103
           and materials.organization_id = 103
           and items1.organization_id = 103
           and components.EFFECTIVITY_DATE <= sysdate
           and nvl(components.DISABLE_DATE,sysdate+1) > sysdate
           ) t
connect by prior t.segment1_sub = t.segment1_m
 start with t.segment1_m = 'S-7BR1AUX-B1';

 

--connect by prior t.sub_id = t.m_id
-- start with t.m_id = '19044'

相关文章:

  • 2021-10-03
  • 2021-10-03
  • 2021-12-13
  • 2022-01-16
  • 2022-03-05
  • 2023-03-07
猜你喜欢
  • 2022-12-23
  • 2022-01-09
  • 2021-06-05
  • 2021-08-14
  • 2022-01-19
相关资源
相似解决方案