feat: refs #8057 Added geoFk columns #3204
|
@ -10,9 +10,9 @@ CREATE OR REPLACE TEMPORARY TABLE tAddressGeo
|
|||
FROM address a
|
||||
JOIN town t ON t.provinceFk = a.provinceFk
|
||||
JOIN postCode p ON p.townFk = t.id
|
||||
guillermo marked this conversation as resolved
|
||||
AND p.`code` = a.postalCode
|
||||
GROUP BY a.id
|
||||
ORDER BY (a.city SOUNDS LIKE t.`name`) DESC;
|
||||
ORDER BY (a.city SOUNDS LIKE t.`name`) DESC,
|
||||
(p.code = a.postalCode) DESC;
|
||||
|
||||
UPDATE address a
|
||||
JOIN tAddressGeo tag ON tag.id = a.id
|
||||
|
|
|
@ -13,9 +13,9 @@ CREATE OR REPLACE TEMPORARY TABLE tClientGeo
|
|||
FROM client c
|
||||
JOIN town t ON t.provinceFk = c.provinceFk
|
||||
JOIN postCode p ON p.townFk = t.id
|
||||
AND p.`code` = c.postcode
|
||||
GROUP BY c.id
|
||||
ORDER BY (c.city SOUNDS LIKE t.`name`) DESC;
|
||||
ORDER BY (c.city SOUNDS LIKE t.`name`) DESC,
|
||||
(p.code = c.postcode) DESC;
|
||||
|
||||
UPDATE client c
|
||||
JOIN tClientGeo tcg ON tcg.id = c.id
|
||||
|
|
|
@ -12,9 +12,11 @@ CREATE OR REPLACE TEMPORARY TABLE tSupplierGeo
|
|||
FROM supplier s
|
||||
JOIN town t ON t.provinceFk = s.provinceFk
|
||||
JOIN postCode p ON p.townFk = t.id
|
||||
guillermo marked this conversation as resolved
pako
commented
Lo mismo de antes Lo mismo de antes
|
||||
AND p.`code` = s.postCode
|
||||
LEFT JOIN supplierAddress sad ON sad.supplierFk = s.id
|
||||
GROUP BY s.id
|
||||
ORDER BY (s.city SOUNDS LIKE t.`name`) DESC;
|
||||
ORDER BY (s.city SOUNDS LIKE t.`name`) DESC,
|
||||
(p.code = s.postCode) DESC,
|
||||
(p.code = sad.postalCode) DESC;
|
||||
|
||||
UPDATE supplier s
|
||||
JOIN tSupplierGeo tsg ON tsg.id = s.id
|
||||
|
|
Loading…
Reference in New Issue
Lo mismo, pondria la restriccion del postcode en el order by