Ver originalSELECT t1.kit, SUM(t1.cantidad) FROM (SELECT pedido, kit, cantidad FROM `kits` GROUP BY pedido, kit)t1 GROUP BY t1.kit