SELECT DISTINCT O.OPRID , X.REQ_ID FROM PS_SPF_BID_LINE B , PS_SPF_REQ_LINE R , PS_PV_REQ_LN_XREF X , PSOPRALIAS O WHERE X.BUSINESS_UNIT = B.BUSINESS_UNIT AND X.SP_REQ_ID = B.SP_REQ_ID AND X.BUSINESS_UNIT = R.BUSINESS_UNIT AND X.SP_REQ_ID = R.SP_REQ_ID AND X.LINE_NBR = R.LINE_NBR AND R.SP_REQ_STATUS <> 'X' AND B.BID_TYP = 'SUP' AND B.SPF_BID_STATUS = 'S' AND O.OPRALIASTYPE = 'SPP' AND O.PERSON_ID = B.SPF_SENT_FROM AND B.LINE_ROW = ( SELECT MAX(LINE_ROW) FROM PS_SPF_BID_LINE B2 WHERE B2.BUSINESS_UNIT = B.BUSINESS_UNIT AND B2.BID_ID = B.BID_ID)
|