30 lines
875 B
SQL
30 lines
875 B
SQL
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
|
SQL SECURITY DEFINER
|
|
VIEW `vn`.`itemShelvingStockFull`
|
|
AS SELECT `ish`.`itemFk` AS `itemFk`,
|
|
`ish`.`visible` AS `quantity`,
|
|
`ish`.`packing` AS `packing`,
|
|
`ish`.`grouping` AS `grouping`,
|
|
`s`.`description` AS `sector`,
|
|
`issr`.`removed` AS `removed`,
|
|
`p`.`sectorFk` AS `sectorFk`,
|
|
`s`.`warehouseFk` AS `warehouseFk`,
|
|
`ish`.`shelvingFk` AS `shelvingFk`,
|
|
`p`.`code` AS `parkingCode`,
|
|
`sh`.`parkingFk` AS `parkingFk`,
|
|
`ish`.`id` AS `itemShelvingFk`,
|
|
`ish`.`created` AS `created`
|
|
FROM (
|
|
(
|
|
(
|
|
(
|
|
`vn`.`itemShelving` `ish`
|
|
JOIN `vn`.`shelving` `sh` ON(`sh`.`id` = `ish`.`shelvingFk`)
|
|
)
|
|
JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
|
|
)
|
|
JOIN `vn`.`sector` `s` ON(`s`.`id` = `p`.`sectorFk`)
|
|
)
|
|
LEFT JOIN `vn`.`itemShelvingStockRemoved` `issr` ON(`issr`.`itemShelvingFk` = `ish`.`id`)
|
|
)
|