SELECT A.SETID ,A.INV_ITEM_ID ,E.MFG_ID ,E.MFG_ITM_ID ,I.DESCR60 ,A.CATEGORY_ID ,A.UNIT_MEASURE_STD ,F.DESCR ,A.DESCR60 ,C.TREE_NAME ,F.PRICE_LIST ,F.CURRENCY_CD FROM PS_MASTER_ITEM_TBL A , PS_ITEM_MFG E , PS_MANUFACTURER I , PSTREENODE C , PS_PURCH_ITEM_ATTR F , PS_ITM_CAT_TBL J , PSTREEDEFN Z WHERE A.SETID = E.SETID AND A.INV_ITEM_ID = E.INV_ITEM_ID AND E.SETID = I.SETID AND E.MFG_ID = I.MFG_ID AND E.PREFERRED_MFG = 'Y' AND A.ITM_STATUS_CURRENT = '1' AND A.SETID = C.SETID AND A.SETID = F.SETID AND A.INV_ITEM_ID = F.INV_ITEM_ID AND F.SUBITEM_ONLY <> 'Y' AND ((%CurrentDateIn >= F.PO_AVAIL_DT) AND (F.PO_UNAVAIL_DT > %CurrentDateIn )) AND A.SETID = J.SETID AND J.EFF_STATUS = 'A' AND A.CATEGORY_ID = J.CATEGORY_ID AND J.EFFDT = ( SELECT MAX(EFFDT) FROM PS_ITM_CAT_TBL WHERE SETID = J.SETID AND CATEGORY_ID = J.CATEGORY_ID AND CATEGORY_CD = J.CATEGORY_CD AND EFFDT <= %CurrentDateIn) AND J.CATEGORY_CD = C.TREE_NODE AND C.EFFDT = ( SELECT MAX(EFFDT) FROM PSTREENODE WHERE SETID = C.SETID AND EFFDT <= %CurrentDateIn AND TREE_NAME = C.TREE_NAME) AND C.TREE_NAME = Z.TREE_NAME AND C.EFFDT = Z.EFFDT AND C.SETID = Z.SETID AND Z.EFF_STATUS = 'A' AND Z.TREE_STRCT_ID = 'ITEMS'
|