SELECT DISTINCT B.OPRID , E.SETID , A.BUSINESS_UNIT , A.DESCR FROM PS_BUS_UNIT_TBL_FS A , PS_SEC_BU_OPR B , PS_SET_CNTRL_REC E WHERE (EXISTS ( SELECT BUSINESS_UNIT FROM PS_BUS_UNIT_TBL_PM B WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT) OR EXISTS ( SELECT BUSINESS_UNIT FROM PS_BUS_UNIT_TBL_AP C WHERE A.BUSINESS_UNIT = C.BUSINESS_UNIT) OR EXISTS ( SELECT BUSINESS_UNIT FROM PS_BUS_UNIT_TBL_GL F WHERE A.BUSINESS_UNIT = F.BUSINESS_UNIT) OR EXISTS ( SELECT BUSINESS_UNIT_GL FROM PS_BUS_UNIT_TBL_EX D WHERE A.BUSINESS_UNIT = D.BUSINESS_UNIT_GL)) AND A.BUSINESS_UNIT = E.SETCNTRLVALUE AND E.RECNAME = 'VAT_APORT_VALUE' AND A.BUSINESS_UNIT = B.BUSINESS_UNIT
|