SELECT a.business_unit , a.common_id , a.item_nbr , d.language_cd , d.descr , t.descr FROM ps_item_sf a , PS_ITEM_LINE_SF c , ps_item_type_lng d , ps_bus_unit_tbl_sf e , ps_ext_org_lang f , ps_ext_org_lang t WHERE c.business_unit = a.business_unit AND c.common_id = a.common_id AND c.sa_id_type = a.sa_id_type AND c.item_nbr = a.item_nbr AND a.sa_id_type = 'O' AND d.item_type = a.item_type AND e.business_unit = a.business_unit AND a.common_id = f.ext_org_id AND f.effdt = ( SELECT MAX(g.effdt) FROM ps_ext_org_lang g WHERE g.ext_org_id = f.ext_org_id AND g.effdt <= %CurrentDateIn) AND d.setid= ( SELECT h.setid FROM ps_set_cntrl_rec h WHERE h.setcntrlvalue = e.institution AND h.recname='ITEM_TYPE_TBL') AND d.effdt = ( SELECT MAX(i.effdt) FROM ps_item_type_lng i WHERE i.setid = d.setid AND i.item_type = d.item_type AND i.effdt <= %CurrentDateIn)
|