SELECT DAT.EMPLID , DAT.EMPL_RCD , DAT.EFFDT , DAT.EFFSEQ ,S.OPRID FROM PS_MIL_RANK_DAT DAT , PS_MIL_RANK_XREF X , PS_EOAW_STEP_VW S WHERE DAT.WF_STATUS <> 'C' AND X.EOAWTHREAD_ID = S.EOAWTHREAD_ID AND X.EOAWPRCS_ID = S.EOAWPRCS_ID AND X.EMPLID = DAT.EMPLID AND X.EMPL_RCD = DAT.EMPL_RCD AND X.EFFDT = DAT.EFFDT AND X.EFFSEQ = DAT.EFFSEQ AND S.EOAWSTEP_STATUS IN ('P' , 'N') AND X.EOAWPARENT_THREAD = ( SELECT MAX(Y.EOAWPARENT_THREAD) FROM PS_MIL_RANK_XREF Y WHERE X.EMPLID = Y.EMPLID AND X.EMPL_RCD = Y.EMPL_RCD AND X.EFFDT = Y.EFFDT AND X.EFFSEQ = Y.EFFSEQ AND Y.EOAWTHREAD_STATUS <> 'T')
|