SELECT COUNT(*) WHERE a.codice = b.codice GROUP BY b.codice