refs #6493 refactorizar-procedimientos-vn2008-parte_2 #2235

Merged
jbreso merged 39 commits from 6493-refactorizar-procedimientos-vn2008-parte_2 into dev 2024-04-24 05:18:59 +00:00
2 changed files with 8 additions and 7 deletions
Showing only changes of commit 1534402640 - Show all commits

View File

@ -75,9 +75,9 @@ proc: BEGIN
(INDEX (itemFk,warehouseFk))
ENGINE = MEMORY
jbreso marked this conversation as resolved Outdated

eliminar esquema vn, no es necesario

eliminar esquema vn, no es necesario
SELECT i.itemFk,
jbreso marked this conversation as resolved Outdated

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

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

Tab

Tab
t.landed,
b.quantity
FROM buy b
JOIN entry e ON b.entryFk = e.id
jbreso marked this conversation as resolved Outdated

Tab

Tab
JOIN travel t ON t.id = e.travelFk

View File

@ -206,7 +206,8 @@ BEGIN
SUM(b2.', vTwoYearsAgo,') twoYearsAgo
jbreso marked this conversation as resolved Outdated

(Tab) GROUP BY b1.id)
sub ON sub.id = b.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

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

Utilizar un solo DROP para dropear las 2 tablas.

Utilizar un solo DROP para dropear las 2 tablas.
b.', vOneYearAgo, ' = oneYearAgo,
b.', vTwoYearsAgo, ' = twoYearsAgo');