CREATE ALGORITHM = UNDEFINED DEFINER = `ATS`@`localhost` SQL SECURITY DEFINER VIEW `ATS`.`vw_prosp_corp_attach` AS SELECT `a`.`idprosp_corp_attach` AS `idprosp_corp_attach`, `a`.`idprosp_corp` AS `idprosp_corp`, `a`.`idstorage` AS `idstorage`, `c`.`owner_id` AS `owner_id`, `c`.`owner_name` AS `owner_name`, `c`.`file_name` AS `file_name`, `c`.`public` AS `public`, `c`.`self_view` AS `self_view`, `c`.`shared` AS `shared`, `c`.`emp_id` AS `emp_id`, `c`.`emp_name` AS `emp_name`, `a`.`updater` AS `updater`, IFNULL(`b`.`fullname`, 'Admin') AS `updated_by`, `b`.`emp_file_name` AS `updater_file_name`, `a`.`last_updated` AS `last_updated`, DATE_FORMAT(`a`.`last_updated`, '%m-%d-%y %h:%i %p') AS `last_updated_formatted` FROM ((`ATS`.`prosp_corp_attach` `a` LEFT JOIN `ATS`.`vw_emp` `b` ON ((`b`.`emp_id` = `a`.`updater`))) LEFT JOIN `ATS`.`vw_storages` `c` ON ((`a`.`idstorage` = `c`.`idstorage`))) ORDER BY `a`.`last_updated` DESC