refs #6493 refactorizar-procedimientos-vn2008-parte_2 #2235
|
@ -75,9 +75,9 @@ proc: BEGIN
|
|||
(INDEX (itemFk,warehouseFk))
|
||||
ENGINE = MEMORY
|
||||
jbreso marked this conversation as resolved
Outdated
|
||||
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,
|
||||
i.shipped dated,
|
||||
i.quantity
|
||||
vWarehouseLanding warehouseFk,
|
||||
jbreso marked this conversation as resolved
Outdated
guillermo
commented
Tab Tab
|
||||
i.shipped dated,
|
||||
i.quantity
|
||||
FROM itemTicketOut i
|
||||
JOIN tItemRangeLive ir ON ir.itemFK = i.itemFk
|
||||
WHERE i.shipped >= vDatedFrom
|
||||
|
@ -85,9 +85,9 @@ proc: BEGIN
|
|||
AND i.warehouseFk = vWarehouseLanding
|
||||
UNION ALL
|
||||
SELECT b.itemFk,
|
||||
vWarehouseLanding,
|
||||
t.landed,
|
||||
b.quantity
|
||||
vWarehouseLanding,
|
||||
jbreso marked this conversation as resolved
Outdated
guillermo
commented
Tab Tab
|
||||
t.landed,
|
||||
b.quantity
|
||||
FROM buy b
|
||||
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
|
||||
|
|
|
@ -206,7 +206,8 @@ BEGIN
|
|||
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
|
||||
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,
|
||||
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.', vTwoYearsAgo, ' = twoYearsAgo');
|
||||
|
|
Loading…
Reference in New Issue
eliminar esquema vn, no es necesario