SELECT B.BUSINESS_UNIT , B.REQ_ID , B.LINE_NBR , L.DESCR254_MIXED , B.COMMENT_ID , B.RANDOM_CMMT_NBR , A.SCM_ATTACH_ID , A.ATT_VERSION , A.ATTACHUSERFILE , A.ATTACHSYSFILENAME , C.COMMENTS_2000 FROM PS_REQ_COMMENTS B FULL OUTER JOIN PS_PV_REQ_ATTCH A ON A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.REQ_ID = B.REQ_ID AND A.RANDOM_CMMT_NBR = B.RANDOM_CMMT_NBR FULL OUTER JOIN PS_REQ_LINE L ON L.BUSINESS_UNIT = B.BUSINESS_UNIT AND L.REQ_ID = B.REQ_ID AND L.LINE_NBR = B.LINE_NBR ,PS_COMMENTS_TBL C ,PS_REQ_HDR H WHERE H.BUSINESS_UNIT = B.BUSINESS_UNIT AND H.REQ_ID = B.REQ_ID AND C.COMMENT_ID = B.COMMENT_ID AND C.RANDOM_CMMT_NBR = B.RANDOM_CMMT_NBR AND B.COMMENT_TYPE <> 'SHP' AND B.APPR_JUSTIFY_FLG <> 'Y' AND B.STATUS = 'A' AND H.ORIG_TRAN IN ('EPO','SPO', 'REQ') UNION ALL SELECT B.BUSINESS_UNIT , B.REQ_ID , B.LINE_NBR , L.DESCR254_MIXED , B.COMMENT_ID , B.RANDOM_CMMT_NBR , A.SCM_ATTACH_ID , A.ATT_VERSION , A.ATTACHUSERFILE , A.ATTACHSYSFILENAME , C.COMMENTS_2000 FROM PS_REQ_COMMENTS B FULL OUTER JOIN PS_PV_ATTACHMENTS A ON A.SCM_ATTACH_ID = B.SCM_ATTACH_ID AND A.ATT_VERSION = B.ATT_VERSION FULL OUTER JOIN PS_REQ_LINE L ON L.BUSINESS_UNIT = B.BUSINESS_UNIT AND L.REQ_ID = B.REQ_ID AND L.LINE_NBR = B.LINE_NBR , PS_COMMENTS_TBL C , PS_REQ_HDR H WHERE H.BUSINESS_UNIT = B.BUSINESS_UNIT AND H.REQ_ID = B.REQ_ID AND C.COMMENT_ID = B.COMMENT_ID AND C.RANDOM_CMMT_NBR = B.RANDOM_CMMT_NBR AND B.COMMENT_TYPE <> 'SHP' AND B.APPR_JUSTIFY_FLG <> 'Y' AND B.STATUS = 'A' AND H.ORIG_TRAN IN ( 'REQ', 'EPO', 'SPO')
|