SELECT DISTINCT B.SETID , B.TREE_NODE , C.DESCR60 FROM PSTREEDEFN A , PSTREENODE B , PS_ITM_CAT_TBL C WHERE A.SETID = B.SETID AND A.SETCNTRLVALUE = B.SETCNTRLVALUE AND A.TREE_NAME = B.TREE_NAME AND A.EFFDT = ( SELECT MAX(A1.EFFDT) FROM PSTREEDEFN A1 WHERE A1.SETID = A.SETID AND A1.SETCNTRLVALUE = A.SETCNTRLVALUE AND A1.TREE_NAME = A.TREE_NAME AND A1.EFF_STATUS = 'A' AND A1.EFFDT <= %CurrentDateIn) AND B.SETID = C.SETID AND B.TREE_NODE = C.CATEGORY_CD AND C.EFFDT = ( SELECT MAX(C1.EFFDT) FROM PS_ITM_CAT_TBL C1 WHERE C1.SETID = C.SETID AND C1.CATEGORY_CD = C.CATEGORY_CD AND C1.EFF_STATUS = 'A' AND C1.EFFDT <= %CurrentDateIn)
|