SELECT B.GB_GROUP_ID , A.GB_OPRID , B.PNLGRPNAME , C.DESCR FROM PS_GB_SECGRPOPR_TB A , PS_GB_SECPNLG_TBL B , PS_GB_GROUP_TBL C WHERE A.GB_GROUP_ID = B.GB_GROUP_ID AND A.GB_GROUP_ID = C.GB_GROUP_ID AND A.GB_OPRID = B.GB_OPRID AND A.EFFDT = B.EFFDT AND A.EFFDT = ( SELECT MAX(EFFDT) FROM PS_GB_SECGRPOPR_TB WHERE A.GB_GROUP_ID = GB_GROUP_ID AND A.GB_OPRID = GB_OPRID AND EFFDT <= %CurrentDateIn) AND A.EFF_STATUS = 'A' AND C.EFFDT = ( SELECT MAX(EFFDT) FROM PS_GB_GROUP_TBL WHERE A.GB_GROUP_ID = GB_GROUP_ID AND EFFDT <= %CurrentDateIn)
|