Ver originalSELECT (sum(t1.precio_com*t1.cantidad) / sum(t1.cantidad)) as promedioFROM (select precio_com,cantidad from det_com_venta where codpro = 1 order by codventa limit 10) t1;