SELECT DISTINCT a.HR_TP_ID ,d.HRXAXISRATINGS ,a.EFFDT FROM PS_HR_TPOOL a ,PS_HR_TP_RB_SELECT b ,PS_HR_RATINGS_BOX c ,PS_HR_RB_X_RATINGS d WHERE a.STATUS = 'A' AND a.HR_SP_CAND_SRCH = 'Y' AND b.HR_TP_ID = a.HR_TP_ID AND b.EFFDT = a.EFFDT AND EXISTS ( SELECT rb.HR_RATINGS_BOX_ID FROM PS_HR_TP_RB_DATA rb WHERE rb.HR_TP_ID = b.HR_TP_ID AND rb.EFFDT = b.EFFDT AND rb.HR_RATINGS_BOX_ID = b.HR_RATINGS_BOX_ID) AND c.HR_RATINGS_BOX_ID = b.HR_RATINGS_BOX_ID AND c.EFF_STATUS = 'A' AND c.HR_RB_TPOOL_IND = 'Y' AND %EffdtCheck(HR_RATINGS_BOX c1, c, b.EFFDT) AND d.HR_RATINGS_BOX_ID = c.HR_RATINGS_BOX_ID AND d.EFFDT = c.EFFDT
|