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

21 lines
584 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`.`itemShelvingSaleSum`
AS SELECT `iss`.`id` AS `id`,
`iss`.`itemShelvingFk` AS `itemShelvingFk`,
`iss`.`saleFk` AS `saleFk`,
sum(`iss`.`quantity`) AS `quantity`,
`iss`.`created` AS `created`,
`p`.`sectorFk` AS `sectorFk`
FROM (
(
(
`vn`.`itemShelvingSale` `iss`
JOIN `vn`.`itemShelving` `ish` ON(`ish`.`id` = `iss`.`itemShelvingFk`)
)
2024-11-13 08:56:38 +00:00
JOIN `vn`.`shelving` `sh` ON(`sh`.`id` = `ish`.`shelvingFk`)
)
JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
)
GROUP BY `iss`.`saleFk`