select rel_id, rel_type, object_id_one from acs_rels where object_id_two = :from_user_id and object_id_one not in (select object_id_one from acs_rels where object_id_two = :to_user_id ) select rel_id, rel_type, object_id_one from acs_rels where object_id_two = :user_id select c.community_id from acs_rels r, dotlrn_communities c where r.object_id_one = :contact_id and r.object_id_two = c.community_id