Ver originalSET @cont = 0;SELECT @num := COUNT(`RecId`) FROM tablagigante;SELECT AVG(`Press`), (@cont := @cont +1) AS INCREMENTALFROM tablagiganteGROUP BY `RecId`HAVING INCREMENTAL % CEILING(@num / 50) = 1;