0

I have the current table structure (simplified) wich much more poulated columns that i don't want to lose.

 id |           url          | atrib1 | atrib2 |atrib3
 1  | http://example.com/123 |        |        | 
 2  | http://example.com/545 |        |        |  
 3  | http://example.com/323 |        |        | 

AND the following CSV file:

id |           url          | atrib1 | atrib2 |atrib3
1  | http://example.com/123 | 195    | 65     | 15
2  | http://example.com/545 | 185    | 55     | 14
3  | http://example.com/323 | 205    | 70     | 18

Now what i want to do is to link the values from the atrib1, atrib2, atrib3 column of the csv to the existing values from url column from the mysql table.

PS: i thinked to add an extra link2 from the csv like:

INSERT INTO table(link2,atrib1,atrib2,atrib3) VALUES ('http://example.com/123','185','65','15') WHERE url2 = url;


id |           url2         | atrib1 | atrib2 |atrib3
1  | http://example.com/123 | 195    | 65     | 15
2  | http://example.com/545 | 185    | 55     | 14
3  | http://example.com/323 | 205    | 70     | 18

But what i was thinking at is not ok.

The problem is i did'nt found a way to do this. How this can be done?

m3tsys
  • 3,939
  • 6
  • 31
  • 45

0 Answers0