SELECT A.AGC_LIST_ID , B.AGC_ACTION_ITEM_ID FROM PS_AGC_TMPL_TBL A , PS_AGC_TMPL_STEPS B , PS_AGC_CAT_TBL C , PS_AGC_CAT_STEPCTX D WHERE A.AGC_TEMPLATE_ID=B.AGC_TEMPLATE_ID AND A.EFFDT = B.EFFDT AND C.AGC_CATEGORY_ID = A.AGC_CATEGORY_ID AND C.EFFDT= ( SELECT MAX(EFFDT) FROM PS_AGC_CAT_TBL C1 WHERE C1.AGC_CATEGORY_ID = C.AGC_CATEGORY_ID AND C1.EFFDT <= A.EFFDT) AND D.AGC_CATEGORY_ID = C.AGC_CATEGORY_ID AND D.EFFDT = C.EFFDT AND B.AGC_STEP_ID = D.AGC_STEP_ID AND D.AGC_RC_PARAM_NAME='PROCESS_TYPE' AND D.AGC_PARAM_VALUE IN ('O')
|