MySQL Forums
Forum List  »  Italian

update con join
Posted by: Max Mary
Date: May 02, 2019 08:13AM

Salve, ho problema di disallineamento dei dati tra due tabelle rilevato da questa query:

SELECT support.cap.prov, support.cap.comune, support.cap.fraz, support.comuni.prov_sigla, support.comuni.prov_full
FROM support.cap, support.comuni
WHERE support.comuni.comune COLLATE utf8mb4_general_ci = support.cap.comune
AND support.comuni.prov_sigla <> support.cap.prov;

Sono più di 400 righe da aggiornare...

Mi sono preparato l'update:
UPDATE support.cap
INNER JOIN support.comuni
ON support.cap.prov = support.comuni.prov_sigla
SET support.cap.prov = support.comuni.prov_sigla
WHERE support.comuni.comune COLLATE utf8mb4_general_ci = support.cap.comune
AND support.comuni.prov_sigla <> support.cap.prov;

La query è pesante ci mette circa 60 secondi l'update dopo 5 millesimi di secondo mi dice che non ci sono righe da aggiornare.
Dove sbaglio???
Grazie

Options: ReplyQuote


Subject
Views
Written By
Posted
update con join
722
May 02, 2019 08:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.