select username from table where username != '' and username not like 'deleted%' and username not in (select username from other_table) group by username having count(*) > 1;