SQL Select Rows с именами Simlar
select name, COUNT(*) as count
from (
select distinct id, name
from mytable) as sq
group by name
Stupid Ninja
select name, COUNT(*) as count
from (
select distinct id, name
from mytable) as sq
group by name