Coobi Posted August 1, 2019 Report Share Posted August 1, 2019 Hallo zusammen, ich bin gerade an einer Migration von xt:4 auf xt:6, nun habe ich das Problem das mir die Gewichte der Artikel nicht in die Datenbank übernommen wurden, diese würde ich jetzt gerne per SQL Update Befehl nachträglich aktualisieren, ich habe einen Dump der bestehenden Datenbank gemacht, hier habe ich das products_model und das products_weight exportiert. Das sieht dann so aus: INSERT INTO `xt_products` (`products_model`, `products_weight`) VALUES ('109', '0.0000'), ('109-01', '0.0000'), ('109-02', '0.1000'), ('109-03', '11.0000'), ('109-04', '0.0000'), ('109-05', '0.0000'), ('109-06', '0.0000'), ('109-07', '0.0000'), ('158', '0.0000'), ('158-01', '0.0000'), ('158-02', '0.0000'), ('158-03', '0.0000'), ('158-04', '0.0000'), ('158-05', '11.0000'), usw... Es sollte doch nun über einen Update Befehl möglich sein, die Gewichte abzugleichen, ich habe keinen Befehl gefunden der quasi das Products_modell miteinander vergleicht und dann entsprechend die Gewichte aktualisiert. Kann mir da jemand helfen ? Ich wäre euch sehr dankbar. Gruß Coobi Quote Link to comment Share on other sites More sharing options...
Coobi Posted August 1, 2019 Author Report Share Posted August 1, 2019 Habs hinbekommen... Danke euch. Quote Link to comment Share on other sites More sharing options...
Alex@4tfm Posted August 1, 2019 Report Share Posted August 1, 2019 24 minutes ago, Coobi said: Habs hinbekommen Poste doch mal deinen query, dann hilfst du evtl. dem nächsten der ein ähnliches Problem hat. Quote Link to comment Share on other sites More sharing options...
Coobi Posted August 1, 2019 Author Report Share Posted August 1, 2019 Damit hab ich es hin bekommen: UPDATE `NewDatabase`.`table1` t1 LEFT JOIN `OldDatabase`.`table1` t2 ON t2.`products_model`= t1.`products_model` SET t1.products_weight = t2.products_weight Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.