8144-devToTest_2448 #3216

Merged
alexm merged 256 commits from 8144-devToTest_2448 into test 2024-11-19 07:36:04 +00:00
3 changed files with 13 additions and 13 deletions
Showing only changes of commit 2b770c0201 - Show all commits

View File

@ -7,14 +7,14 @@ CREATE OR REPLACE TEMPORARY TABLE tmp.tAddressGeo
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT a.id, p.geoFk
FROM address a
JOIN town t ON t.provinceFk = a.provinceFk
JOIN postCode p ON p.townFk = t.id
FROM vn.address a
JOIN vn.town t ON t.provinceFk = a.provinceFk
JOIN vn.postCode p ON p.townFk = t.id
GROUP BY a.id
ORDER BY (a.city SOUNDS LIKE t.`name`) DESC,
(p.code = a.postalCode) DESC;
UPDATE address a
UPDATE vn.address a
JOIN tmp.tAddressGeo tag ON tag.id = a.id
SET a.geoFk = tag.geoFk;

View File

@ -10,14 +10,14 @@ CREATE OR REPLACE TEMPORARY TABLE tmp.tClientGeo
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT c.id, p.geoFk
FROM client c
JOIN town t ON t.provinceFk = c.provinceFk
JOIN postCode p ON p.townFk = t.id
FROM vn.client c
JOIN vn.town t ON t.provinceFk = c.provinceFk
JOIN vn.postCode p ON p.townFk = t.id
GROUP BY c.id
ORDER BY (c.city SOUNDS LIKE t.`name`) DESC,
(p.code = c.postcode) DESC;
UPDATE client c
UPDATE vn.client c
JOIN tmp.tClientGeo tcg ON tcg.id = c.id
SET c.geoFk = tcg.geoFk;

View File

@ -9,16 +9,16 @@ CREATE OR REPLACE TEMPORARY TABLE tmp.tSupplierGeo
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT s.id, p.geoFk
FROM supplier s
JOIN town t ON t.provinceFk = s.provinceFk
JOIN postCode p ON p.townFk = t.id
LEFT JOIN supplierAddress sad ON sad.supplierFk = s.id
FROM vn.supplier s
JOIN vn.town t ON t.provinceFk = s.provinceFk
JOIN vn.postCode p ON p.townFk = t.id
LEFT JOIN vn.supplierAddress sad ON sad.supplierFk = s.id
GROUP BY s.id
ORDER BY (s.city SOUNDS LIKE t.`name`) DESC,
(p.code = s.postCode) DESC,
(p.code = sad.postalCode) DESC;
UPDATE supplier s
UPDATE vn.supplier s
JOIN tmp.tSupplierGeo tsg ON tsg.id = s.id
SET s.geoFk = tsg.geoFk;