CREATE OR REPLACE VIEW vw_noticias_img AS select `noticias_img`.`id` AS `id`,`noticias_img`.`id_media` AS `id_media`,`noticias_img`.`id_noticia` AS `id_noticia`,`noticias_img`.`leyenda` AS `leyenda`,`noticias_img`.`orden` AS `orden`,`noticias_img`.`principal` AS `principal`,`media_files`.`type` AS `type`,`media_files`.`name` AS `name`,`media_files`.`filename` AS `filename`,`media_files`.`extension` AS `extension`,`media_files`.`size` AS `size`,`media_files`.`mime` AS `mime`,`media_files`.`mime_download` AS `mime_download`,`media_files`.`download_code` AS `download_code`,`media_files`.`width` AS `width`,`media_files`.`height` AS `height`,replace(if((`media_files`.`size` > ((1024 * 1024) * 1024)),concat(round((`media_files`.`size` / ((1024 * 1024) * 1024)),2),'Gb'),if((`media_files`.`size` > (1024 * 1024)),concat(round((`media_files`.`size` / (1024 * 1024)),2),'Mb'),if((`media_files`.`size` > 1024),concat(round((`media_files`.`size` / 1024),2),'Kb'),concat(`media_files`.`size`,'b')))),'.',',') AS `size_formatted` from (`noticias_img` join `media_files` on((`noticias_img`.`id_media` = `media_files`.`id`)))