select count(*) as num,tb.id
from
tb,
(select role from tb where id=xxx) as t1
where
tb.role = t1.role and tb.id != t1.id
group by tb.id
having
num = select count(role) from tb where id=xxx;
from
tb,
(select role from tb where id=xxx) as t1
where
tb.role = t1.role and tb.id != t1.id
group by tb.id
having
num = select count(role) from tb where id=xxx;