CREATE ALGORITHM = UNDEFINED DEFINER = `ATS`@`localhost` SQL SECURITY DEFINER VIEW `ATS`.`vw_emp_attachment` AS SELECT `a`.`emp_legal_id` AS `emp_legal_id`, `a`.`doc_type` AS `doc_type`, `d`.`look_values` AS `doc_look_values`, `a`.`expire_dt` AS `expire_dt`, `b`.`emp_id` AS `emp_id`, `a`.`idstorage` AS `idstorage`, `a`.`updater` AS `updater`, `c`.`owner_id` AS `owner_id`, `c`.`file_name` AS `file_name`, `c`.`public` AS `public`, `c`.`self_view` AS `self_view`, `c`.`shared` AS `shared`, `c`.`updated_for_ref_id` AS `updated_for_ref_id`, `c`.`updated_for_ref_table` AS `updated_for_ref_table`, `a`.`last_updated` AS `last_updated` FROM (((`ATS`.`emp_legal` `a` LEFT JOIN `ATS`.`storages` `c` ON ((`a`.`idstorage` = `c`.`idstorage`))) LEFT JOIN `ATS`.`emp` `b` ON ((`a`.`emp_id` = `b`.`emp_id`))) LEFT JOIN `ATS`.`look_values` `d` ON ((`a`.`doc_type` = `d`.`look_values_id`))) ORDER BY `a`.`last_updated` DESC