select 
c.cls_code as class,
c.cls_desc as des_text,
c.cls_org as classorganization

from r5userorganization u, r5classes c  
where c.cls_rentity = <parameter.rentity>  and c.cls_org = u.uog_org and 
u.uog_user = <parameter.r5user> and ( u.uog_org = <control.org> OR uog_org ='*' 
OR ( uog_common = '+' and  c.cls_code <> '*'  ) ) and 
COALESCE(c.cls_notused, '-') <> '+'

