我得到了
#1267 - Illegal mix of collations (utf8_general_ci,IMPLICIT) and (latin1_swedish_ci,NUMERIC) for operation '='
以下查询出现此错误
SELECT * FROM
sm_product_inventories_list
WHERE inventory_date = CURDATE()
AND inventory_time = CURTIME()
我试图通过
更改表格的排序规则ALTER TABLE sm_product_inventories_list CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci
我仍然收到错误。 inventory_date 的类型是 date,inventory_time 是 varchar
提前致谢。
最佳答案
一个快速的解决方案是在比较之前添加“二进制”,如下所示,
WHERE binary inventory_date = binary CURDATE() AND binary inventory_time = binary CURTIME()
关于mysql - 错误代码 : 1267 Illegal mix of collations (utf8_general_ci, IMPLICIT) 和 (latin1_swedish_ci,NUMERIC) 用于简单选择查询上的操作 '=' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43368771/