Použijte souhrnný dotaz: select g.ID, g.Name, g.Phone, count(*) over ( partition by g.name ) as Count from Guys g;