18 lines
422 B
SQL
18 lines
422 B
SQL
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
|
SQL SECURITY DEFINER
|
|
VIEW `vn`.`buyerSales`
|
|
AS SELECT `v`.`importe` AS `importe`,
|
|
`w`.`code` AS `comprador`,
|
|
`t`.`year` AS `año`,
|
|
`t`.`week` AS `semana`
|
|
FROM (
|
|
(
|
|
(
|
|
`bs`.`ventas` `v`
|
|
JOIN `vn`.`time` `t` ON(`t`.`dated` = `v`.`fecha`)
|
|
)
|
|
JOIN `vn`.`itemType` `it` ON(`it`.`id` = `v`.`tipo_id`)
|
|
)
|
|
JOIN `vn`.`worker` `w` ON(`w`.`id` = `it`.`workerFk`)
|
|
)
|