select tableA.Col, COUNT(Tableb.ID) as MyCountfrom tableA ajoin Tableb b on a.ID = b.IDgroup by table.Col