Answer the question
In order to leave comments, you need to log in
How to conveniently update/load data into a MYSQL table?
Good afternoon!
New fields appeared in the table, you need to bulk load data into them, a bunch through id.
Table example:
https://yadi.sk/i/KfiwCk6hrL6iT
Sample data to upload
https://yadi.sk/i/W9xTo2rkrL6uV
Tried doing this using INSERT INTO
INSERT INTO regions (country_id,rf_geo_region_id,rf_geo_municipal_districts
,city,city2,additional_geo_info,id) VALUES
(1,47,,'г. Улан-Удэ',,,1),
(1,47,,,,,2),
(1,47,,'г. Северобайкальск',,,3),
(1,47,'р-н Северо-Байкальский',,,,4),
(1,47,'р-н Северо-Байкальский','пгт. Нижнеангарск',,,5),
(1,47,'р-н Северо-Байкальский','пгт. Новый Уоян',,,6),
(1,47,'р-н Баргузинский',,,,7),
(1,47,'р-н Муйский',,,,8),
(1,47,'р-н Муйский','пгт. Северомуйск',,,9),
(1,47,'р-н Бичурский',,,,10),
(1,47,'р-н Джидинский',,,,11),
(1,47,'р-н Еравнинский',,,,12),
(1,47,'р-н Баунтовский эвенкийский',,,,13),
(1,47,'р-н Заиграевский',,,,14),
(1,47,'р-н Закаменский',,,,15),
(1,47,'р-н Кабанский',,,,16),
(1,47,'р-н Иволгинский',,,,17),
(1,47,'р-н Кижингинский',,,,18),
(1,47,'р-н Кяхтинский',,,,19)
ON DUPLICATE KEY UPDATE
country_id = VALUES(country_id),
rf_geo_region_id = VALUES(rf_geo_region_id),
rf_geo_municipal_districts = VALUES(rf_geo_municipal_districts),
city = VALUES(city),
city2 = VALUES(city2),
additional_geo_info = VALUES(additional_geo_info);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question