dankellys
dankellys

Reputation: 43

phpMyAdmin - #1267 - Illegal mix of collations for operation '<'

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

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

I am getting the following error:

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

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...

Any more idea's?

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

Upvotes: 1

Views: 2991

Answers (1)

radar
radar

Reputation: 13425

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)

Upvotes: 1

Related Questions