Ver originalSELECT * FROM tabla t2INNER JOIN ( SELECT MAX(t1.id) AS idmaximoFROM tabla t1GROUP BY t1.categoria)AS t2WHERE idmaximo = id