SELECT DISTINCT A.SOURCE_BUS_UNIT , A.ORDER_NO , A.ORDER_INT_LINE_NO , A.SCHED_LINE_NBR , B.HARD_PEG FROM PS_IN_DEMAND_HASH A , PS_IN_PEGGING B , PS_IN_DEMAND F WHERE A.HASH_KEY = B.DEMAND_HASH AND (B.SUP_ORDER_TYPE = '010' OR B.SUP_ORDER_TYPE = '100') AND B.PEG_STATUS = '10' AND F.BUSINESS_UNIT = A.BUSINESS_UNIT AND F.DEMAND_SOURCE = A.DEMAND_SOURCE AND F.SOURCE_BUS_UNIT = A.SOURCE_BUS_UNIT AND F.ORDER_NO = A.ORDER_NO AND F.ORDER_INT_LINE_NO = A.ORDER_INT_LINE_NO AND F.SCHED_LINE_NBR = A.SCHED_LINE_NBR AND F.INV_ITEM_ID = A.INV_ITEM_ID AND F.DEMAND_LINE_NO = A.DEMAND_LINE_NO AND F.IN_FULFILL_STATE < '60' AND F.PEG_STATUS = '10' AND F.DEMAND_SOURCE = 'OM'
|