Ver originalSELECT tabla.id, tabla.columnaA, tabla. columnaB FROM tabla INNER JOIN ( SELECT MAX( id ) FECH, columnaA FROM tabla GROUP BY columnaA) t1 ON t1.columnaA = tabla.columnaA AND t1.FECH = tabla.id ORDER BY id DESC;