select 
c.cst_code as costcode,
c.cst_org as costcodeorganization,
c.cst_desc as costcodedescription
from  r5costcodes c, r5userorganization u where  
IFNULL( c.cst_notused, '-' ) = '-' and  c.cst_org = u.uog_org and u.uog_user = <parameter.r5user> 
and  ( u.uog_common = '+' or u.uog_org = <control.org> )
