Ver originalSELECT *FROM MiTabla aWHERE EXISTS ( SELECT MAX(ID) FROM MiTabla b WHERE a.ID = b.ID GROUP BY FOLIO)