Use uma consulta agregada: select g.ID, g.Name, g.Phone, count(*) over ( partition by g.name ) as Count from Guys g;