SELECT codiceO, COUNT(codiceP) AS countP FROM Ordini GROUP BY codiceO