I follow this guide to export column

http://stackoverflow.com/questions/4486743/how-do-i-export-particular-column-in-mysql-using-phpmyadmin

my Sql table is : ID , Name , description , url ,tag ,category_id .......................

So i want to export column name and to translate all names to different language the problem is How to import column name back to same table but with changes ? for examp :

Id =1 name = hello    after import -> Id =1 name = Здравей
Id =2 name = Bye      after import -> Id =2 name = чао

that i want to happen after the import .

有帮助吗?

解决方案 2

You can use LOAD DATA INFILE to bulk load the 800,000 rows of data into a temporary table, then use multiple-table UPDATE syntax to join your existing table to the temporary table and update the quantity values.

For example:

CREATE TEMPORARY TABLE your_temp_table LIKE your_table;

LOAD DATA INFILE '/tmp/your_file.csv'
INTO TABLE your_temp_table
FIELDS TERMINATED BY ','
(id, product, sku, department, quantity); 

UPDATE your_table
INNER JOIN your_temp_table on your_temp_table.id = your_table.id
SET your_table.quantity = your_temp_table.quantity;

DROP TEMPORARY TABLE your_temp_table;

https://stackoverflow.com/a/10253773/4238757

其他提示

One way to do is create a temp table, import your modified info to it and update the first table joining the two. later on, delete the temp table.

Do something like this:

  • Create a query to display only id and name fields from table1.
  • Export the results to a sql file.
  • Translate the names into Russian and save the file.
  • Create a new table (like tmpTable) with two fields named the same as the ones you exported.
  • Import the sql file into newly created tmpTable.
  • Build the INSERT query joining the two tables,like:

UPDATE table1 JOIN tempTable ON table1.id = tempTable.id SET table1.name = tempTable.name

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top