feat: refs #6500 procRefactor8 #2131
|
@ -10,7 +10,7 @@ BEGIN
|
|||
JOIN (
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT id, landed, tt.warehouseInFk, tt.warehouseOutFk
|
||||
SELECT t.id, t.landed, tt.warehouseInFk, tt.warehouseOutFk
|
||||
robert marked this conversation as resolved
Outdated
|
||||
FROM travel t
|
||||
JOIN (
|
||||
SELECT t.warehouseInFk, t.warehouseOutFk
|
||||
|
@ -19,11 +19,11 @@ BEGIN
|
|||
JOIN travel t ON t.id = e.travelFk
|
||||
GROUP BY t.warehouseInFk, t.warehouseOutFk
|
||||
) tt ON t.warehouseInFk = tt.warehouseInFk AND t.warehouseOutFk = tt.warehouseOutFk
|
||||
WHERE shipped > util.VN_CURDATE() AND isDelivered = FALSE
|
||||
WHERE shipped > util.VN_CURDATE() AND NOT isDelivered
|
||||
robert marked this conversation as resolved
Outdated
carlosap
commented
isDelivered = FALSE NOT isDelivered Faltan alias isDelivered = FALSE
NOT isDelivered
Faltan alias
|
||||
ORDER BY t.landed
|
||||
LIMIT 10000000000000000000
|
||||
) t
|
||||
GROUP BY warehouseInFk, warehouseOutFk
|
||||
GROUP BY t.warehouseInFk, t.warehouseOutFk
|
||||
) tt ON t.warehouseInFk = tt.warehouseInFk AND t.warehouseOutFk = tt.warehouseOutFk
|
||||
SET e.travelFk = t.id;
|
||||
|
||||
|
|
|
@ -18,14 +18,14 @@ BEGIN
|
|||
( SELECT
|
||||
t.year,
|
||||
t.month,
|
||||
CAST(SUM(divisa) AS DECIMAL(10,2)) dollars,
|
||||
CAST(SUM(divisa) / SUM(amount) AS DECIMAL(5,4)) changePractical,
|
||||
CAST(SUM(p.divisa) AS DECIMAL(10,2)) dollars,
|
||||
robert marked this conversation as resolved
Outdated
carlosap
commented
faltan alias, no se sabe de que tablas vienen los campos faltan alias, no se sabe de que tablas vienen los campos
|
||||
CAST(SUM(p.divisa) / SUM(p.amount) AS DECIMAL(5,4)) changePractical,
|
||||
CAST(rr.value * 0.998 AS DECIMAL(5,4)) changeOfficial
|
||||
FROM payment p
|
||||
JOIN time t ON t.dated = p.received
|
||||
JOIN referenceRate rr ON rr.dated = p.received
|
||||
JOIN currency c ON c.id = rr.currencyFk
|
||||
WHERE divisa
|
||||
WHERE p.divisa
|
||||
AND c.code = 'USD'
|
||||
GROUP BY t.year, t.month
|
||||
) pagos ON t.year = pagos.year AND t.month = pagos.MONTH
|
||||
robert marked this conversation as resolved
Outdated
carlosap
commented
En la medida de lo posible no se debe de escribir en español, en este caso el nombre de la subconsulta es totalmente evitable que este en español, traducir En la medida de lo posible no se debe de escribir en español, en este caso el nombre de la subconsulta es totalmente evitable que este en español, traducir
|
||||
|
|
Loading…
Reference in New Issue
faltan alias en los campos