Ver originalSELECT T1.*FROM tabla T1 INNER JOIN ( SELECT DISTINCT cod FROM tabla ORDER BY cod DESC LIMIT 2) T2 ON T1.cod = T2.cod;