2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
2024-01-15 11:31:03 +00:00
|
|
|
SQL SECURITY DEFINER
|
|
|
|
VIEW `vn`.`traceabilitySale`
|
|
|
|
AS SELECT `s`.`ticketFk` AS `ticketFk`,
|
|
|
|
`sb`.`buyFk` AS `buyFk`,
|
|
|
|
`t`.`shipped` AS `shipped`,
|
|
|
|
`t`.`nickname` AS `nickname`,
|
|
|
|
`s`.`quantity` AS `quantity`,
|
|
|
|
concat(`w`.`firstName`, ' ', `w`.`lastName`) AS `worker`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
(
|
|
|
|
`vn`.`saleBuy` `sb`
|
|
|
|
JOIN `vn`.`sale` `s` ON(`s`.`id` = `sb`.`saleFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`ticket` `t` ON(`t`.`id` = `s`.`ticketFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`worker` `w` ON(`w`.`id` = `sb`.`workerFk`)
|
|
|
|
)
|