SELECT A.OPRID , B.SEQ_NBR , L.LANGUAGE_CD , D.PORTAL_LABEL , L.FORM_SUBJECT FROM PS_EOAW_STEP_VW A , PS_FORM_AW B , PS_FORM C , PS_FORM_LG L , PS_FORM_TYPE_LG D WHERE A.EOAWPRCS_ID = 'FormApproval' AND A.EOAWTHREAD_ID = B.EOAWTHREAD_ID AND B.SEQ_NBR = C.SEQ_NBR AND C.FORM_TYPE = D.FORM_TYPE AND C.SEQ_NBR = L.SEQ_NBR AND ((A.EOAWSTEP_STATUS = 'P' OR A.EOAWSTEP_STATUS = 'A' OR A.EOAWSTEP_STATUS = 'D' OR A.EOAWSTEP_STATUS = 'H') OR A.EOAWUSER_TYPE = 'R') AND A.EOAWTHREAD_ID = ( SELECT MAX(AA.EOAWTHREAD_ID) FROM PS_EOAW_STEP_VW AA WHERE AA.EOAWPRCS_ID = 'FormApproval' AND AA.EOAWTHREAD_ID = B.EOAWTHREAD_ID )
|