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

18 lines
512 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`.`itemSearch`
AS SELECT `s`.`itemFk` AS `itemFk`,
`s`.`concept` AS `concept`,
`s`.`quantity` AS `quantity`,
`t`.`nickname` AS `nickname`,
`t`.`shipped` AS `shipped`
FROM (
(
`vn`.`sale` `s`
JOIN `vn`.`ticket` `t` ON(`t`.`id` = `s`.`ticketFk`)
)
JOIN `vn`.`warehouse` `w` ON(`w`.`id` = `t`.`warehouseFk`)
)
WHERE `t`.`shipped` BETWEEN `util`.`yesterday`() AND `util`.`tomorrow`()
AND `w`.`name` IN ('VNH', 'Floramondo')