1

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

Community
  • 1
  • 1
dankellys
  • 43
  • 1
  • 6

1 Answers1

1

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)
radar
  • 13,270
  • 2
  • 25
  • 33