Ich möchte meine Tabellen von CSV aktualisieren. Jetzt werden Daten von CSV in die Tabelle "temp_update_stany" importiert, aber ich kann keine Tabellen aktualisieren. Abfrage ohne Fehler, aber nichts wird aktualisiert.Mehrere Tabellen in einer Abfrage aktualisieren, in MySQL
Tabelle von CSV ist:
produkt|quantity|price|active|czas
Abfrage:
UPDATE lp2_product tabela
INNER JOIN lp2_stock_available stany ON (tabela.id_product = stany.id_product)
INNER JOIN lp2_product_lang lang ON (tabela.id_product = lang.id_product)
INNER JOIN temp_update_stany csv ON (tabela.id_product = csv.produkt)
SET
tabela.active = csv.active,
tabela.price = csv.price,
lang.available_now = csv.czas,
stany.quantity = csv.quantity
WHERE
csv.produkt = tabela.id_product
OR csv.produkt = lang.id_product
OR csv.produkt = stany.id_product
und Ausgabe von Abfrage:
Modified records: 0 (Perform queries took 0.0322 seconds (s)).
aber zum Beispiel "lp2_product"/Reihen 'aktiven' Wert haben, 0 für alle Produkte und temp_update_stany haben den Wert 1 für alle.
Ja, das ist Prestashop und einfaches Skript für Update-Menge und Preise.
erstellen Sie ein vollständiges, überprüfbares Beispiel dafür, und ich wette, Sie werden den Fehler sofort sehen. –
BTW: Sie können Ihre WHERE-Klausel vollständig löschen, da die erste Bedingung immer wahr ist (redundant zur JOIN ON-Klausel) und die anderen beiden nicht wichtig sind. –
Was meinst du? Ich habe keine Fehler, aber diese aktualisieren nichts. – Maku123PL