oracle8.1.6 select case when exists (select 1 from acs_object_types t where t.supertype = :group_type) then 1 else 0 end from dual select case when exists (select 1 from acs_rel_types t where t.object_type_one = :group_type or t.object_type_two = :group_type) then 1 else 0 end from dual