postgresql7.1
select count(*)
from (select acs_rels.object_id_two
from acs_rels, membership_rels
where acs_rels.object_id_one = (select acs__magic_object_id('registered_users') from dual)
and acs_rels.rel_id = membership_rels.rel_id
and acs_rels.object_id_two not in (
select acs_rels.object_id_two
from acs_rels,
dotlrn_user_types
where acs_rels.object_id_one = dotlrn_user_types.group_id)) as foo