salix/db/routines/hedera/views/myOrderRow.sql

20 lines
546 B
SQL

CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `hedera`.`myOrderRow`
AS SELECT `orw`.`id` AS `id`,
`orw`.`order_id` AS `orderFk`,
`orw`.`item_id` AS `itemFk`,
`orw`.`warehouse_id` AS `warehouseFk`,
`orw`.`shipment` AS `shipped`,
`orw`.`amount` AS `amount`,
`orw`.`price` AS `price`,
`orw`.`rate` AS `rate`,
`orw`.`created` AS `created`,
`orw`.`Id_Movimiento` AS `saleFk`
FROM `hedera`.`order_row` `orw`
WHERE `orw`.`order_id` IN (
SELECT `myOrder`.`id`
FROM `hedera`.`myOrder`
)
WITH CASCADED CHECK OPTION