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

11 lines
286 B
MySQL
Raw Normal View History

2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`personMedia`
AS SELECT `c`.`id` AS `workerFk`,
IFNULL(`c`.`mobile`, `c`.`phone`) AS `mediaValue`
FROM (
`vn`.`client` `c`
JOIN `vn`.`worker` `w` ON(`w`.`id` = `c`.`id`)
)
HAVING `mediaValue` IS NOT NULL