SELECT
    id as id,
    archivo,
    fecha_edicion,
    usuario,
    lineas,
    IF(caracteres>1024000, CONCAT(FORMAT(caracteres/1024000,0)," Mb"), IF(caracteres>1024,CONCAT(FORMAT(caracteres/1024,0)," Kb"),CONCAT(FORMAT(caracteres,0)," bytes")))
FROM
    core_pcoder_historial 
WHERE 
1=1 AND 
    archivo = "{$PCODER_archivo}"
ORDER BY id DESC
limit 0,10
