salix/db/routines/vn/views/workerTimeControlUserInfo.sql

21 lines
542 B
MySQL
Raw Permalink Normal View History

2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`workerTimeControlUserInfo`
AS SELECT `u`.`id` AS `userFk`,
`w`.`firstName` AS `name`,
`w`.`lastName` AS `surname`,
`u`.`name` AS `user`,
`u`.`password` AS `password`,
`wd`.`departmentFk` AS `departmentFk`,
left(`c`.`fi`, 8) AS `dni`
FROM (
(
(
`account`.`user` `u`
JOIN `vn`.`worker` `w` ON(`w`.`id` = `u`.`id`)
)
JOIN `vn`.`client` `c` ON(`c`.`id` = `u`.`id`)
)
LEFT JOIN `vn`.`workerDepartment` `wd` ON(`wd`.`workerFk` = `w`.`id`)
)