refs #6493 refactorizar-procedimientos-vn2008-parte_2 #2235
|
@ -75,9 +75,9 @@ proc: BEGIN
|
||||||
(INDEX (itemFk,warehouseFk))
|
(INDEX (itemFk,warehouseFk))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
jbreso marked this conversation as resolved
Outdated
|
|||||||
SELECT i.itemFk,
|
SELECT i.itemFk,
|
||||||
jbreso marked this conversation as resolved
Outdated
carlosap
commented
porque se ha cambiado a item_id? porque se ha cambiado a item_id?
|
|||||||
vWarehouseLanding warehouseFk,
|
vWarehouseLanding warehouseFk,
|
||||||
jbreso marked this conversation as resolved
Outdated
guillermo
commented
Tab Tab
|
|||||||
i.shipped dated,
|
i.shipped dated,
|
||||||
i.quantity
|
i.quantity
|
||||||
FROM itemTicketOut i
|
FROM itemTicketOut i
|
||||||
JOIN tItemRangeLive ir ON ir.itemFK = i.itemFk
|
JOIN tItemRangeLive ir ON ir.itemFK = i.itemFk
|
||||||
WHERE i.shipped >= vDatedFrom
|
WHERE i.shipped >= vDatedFrom
|
||||||
|
@ -85,9 +85,9 @@ proc: BEGIN
|
||||||
AND i.warehouseFk = vWarehouseLanding
|
AND i.warehouseFk = vWarehouseLanding
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT b.itemFk,
|
SELECT b.itemFk,
|
||||||
vWarehouseLanding,
|
vWarehouseLanding,
|
||||||
jbreso marked this conversation as resolved
Outdated
guillermo
commented
Tab Tab
|
|||||||
t.landed,
|
t.landed,
|
||||||
b.quantity
|
b.quantity
|
||||||
FROM buy b
|
FROM buy b
|
||||||
JOIN entry e ON b.entryFk = e.id
|
JOIN entry e ON b.entryFk = e.id
|
||||||
jbreso marked this conversation as resolved
Outdated
guillermo
commented
Tab Tab
|
|||||||
JOIN travel t ON t.id = e.travelFk
|
JOIN travel t ON t.id = e.travelFk
|
||||||
|
|
|
@ -206,7 +206,8 @@ BEGIN
|
||||||
SUM(b2.', vTwoYearsAgo,') twoYearsAgo
|
SUM(b2.', vTwoYearsAgo,') twoYearsAgo
|
||||||
jbreso marked this conversation as resolved
Outdated
guillermo
commented
(Tab) GROUP BY b1.id) (Tab) GROUP BY b1.id)
sub ON sub.id = b.id
|
|||||||
FROM tmp.nest b1
|
FROM tmp.nest b1
|
||||||
JOIN tmp.balance_aux b2 on b2.lft BETWEEN b1.lft and b1.rgt
|
JOIN tmp.balance_aux b2 on b2.lft BETWEEN b1.lft and b1.rgt
|
||||||
jbreso marked this conversation as resolved
Outdated
carlosap
commented
funciones en mayúsculas funciones en mayúsculas
|
|||||||
GROUP BY b1.id)sub ON sub.id = b.id
|
GROUP BY b1.id
|
||||||
|
)sub ON sub.id = b.id
|
||||||
SET b.', vYear, ' = thisYear,
|
SET b.', vYear, ' = thisYear,
|
||||||
jbreso marked this conversation as resolved
Outdated
guillermo
commented
Utilizar un solo DROP para dropear las 2 tablas. Utilizar un solo DROP para dropear las 2 tablas.
|
|||||||
b.', vOneYearAgo, ' = oneYearAgo,
|
b.', vOneYearAgo, ' = oneYearAgo,
|
||||||
b.', vTwoYearsAgo, ' = twoYearsAgo');
|
b.', vTwoYearsAgo, ' = twoYearsAgo');
|
||||||
|
|
Loading…
Reference in New Issue
eliminar esquema vn, no es necesario