How to update only one column of sql table by csv file

后端 未结 2 1505
南方客
南方客 2021-01-26 11:09

I have a csv file containg some data. And in my Sql Database I have a table with multiple column name. Now I want to update only one column by csv file. Thanks

2条回答
  •  时光说笑
    2021-01-26 11:56

    As stated by the MySQL Documentation you can do this

    LOAD DATA INFILE 'mycsvdata.csv'
    INTO TABLE mytable
    ( @csvfield1, @csvfield2 )
    SET myTabField = @csvfield2;
    

提交回复
热议问题