How can i add date as auto update when import data from csv file?

前端 未结 2 586
挽巷
挽巷 2021-01-28 13:40

I want to add date and time auto update. Can anyone help me how can i do this. i am importing data from csv file and there is no any field of date i want to auto update this fie

相关标签:
2条回答
  • 2021-01-28 13:44

    Sanjay Rathod --> UPDATE [yourTable] SET [yourDatetimeColumn] = NOW();

    (see this post for more information.)

    0 讨论(0)
  • 2021-01-28 13:58

    Just add a NOW() for that field.

    Or if you have two seperate columns for date and time then you can use the build-in functions CURDATE() and TIME().

    Example:

    LOAD DATA INFILE 'data.csv'
    INTO TABLE t1
    (column1, col2, col3)
    FIELDS TERMINATED BY ';'
    LINES TERMINATED BY '\n'
    SET date_time_field = NOW();
    
    0 讨论(0)
提交回复
热议问题