Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尝试更正导入日期的年份部分时出错。
CSV 日期列值已格式化
2018 年 7 月 21 日而不是 2018 年 7 月 21 日
这导致 MySql 将日期插入为 07/21/0018
我的印象是,如文档中所述,00-69 范围内的年份值已转换为 2000-2069。
有任何解决这个问题的方法吗?我已经尝试了很多没有运气的陈述......
任何帮助表示赞赏
假设您只想更新数据,并且它是 Date、DateTime 或 Timestamp 类型的列,您可以这样做:
UPDATE table SET date = date + INTERVAL 2000 YEAR WHERE YEAR(date) < 70