- 1
- 0
- 约1.98千字
- 约 2页
- 2023-04-10 发布于安徽
- 举报
MySQLDATE_FORMATE函数内置字符集的坑
今天帮同事处理⼀个SQL(简化过后的)执⾏报错:
mysql select date_format(2013-11-19,Y-m-d) timediff(2013-11-19, 2013-11-20);
ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation
乍⼀看挺莫名其妙的,查了下⼿册,发现有这么⼀段:
The language used for day and month names and abbreviations is controlled by the value of the lc_time_names system variable (Section
9.7, “MySQL Server Locale Support”).
The DATE_FORMAT() returns a string with a character set and collation given by character_set_connection and collation_con
原创力文档

文档评论(0)