phpMyAdmin-#1267-操作'<'的排序规则的非法混合 [英] phpMyAdmin - #1267 - Illegal mix of collations for operation '<'

查看:107
本文介绍了phpMyAdmin-#1267-操作'<'的排序规则的非法混合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试运行以下SQL时出现错误:

I am getting an error when trying to run the following SQL:

SELECT * FROM syshealth WHERE 'timestamp' < DATE_SUB(NOW(),INTERVAL 15 MINUTE)

我遇到以下错误:

#1267 - Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<' 

我将表和数据库排序规则设置为 utf8_unicode_ci

I have my table and database collation set to utf8_unicode_ci

我已经阅读了几篇文章,并尝试了最佳答案在这里,但没有成功...

I have read a few articles already, and have tried the top answer here, but without success...

还有其他想法吗?

编辑:其他信息- 时间戳列的类型为 datetime

Additional Info - the 'timestamp' column is of type datetime

推荐答案

您需要使用`(反引号)

You need to use ` (backtick) to identify a column if you use single ' , this will be treated as string literal.

SELECT * FROM syshealth WHERE `timestamp` < DATE_SUB(NOW(),INTERVAL 15 MINUTE)

这篇关于phpMyAdmin-#1267-操作'&lt;'的排序规则的非法混合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆