|
|

楼主 |
发表于 2011/11/21 12:47:12
|
显示全部楼层
已解决,
select nvl(SUM(md.using_requirement_quantity), 0) gross_requirements
from msc_plans,
msc_demands,
msc_system_items msi
where mp.compile_designator = _PLANNING_NAME
and mp.organization_id = :P_ORG_ID
and msi.organization_id = mp.organization_id
and msi.item_name = :ITEM_NO
and msi.plan_id = mp.plan_id
and md.organization_id = msi.organization_id
and md.inventory_item_id = msi.inventory_item_id
and md.plan_id = mp.plan_id
and to_char(md.using_assembly_demand_date, 'YYYYMM') = TO_CHAR(SYSDATE, 'YYYYMM')
and md.origination_type NOT IN (52,60); |
|