MySQL 在 workbench 上似乎 运行 正常的查询中给出错误

MySQL giving an error on a query that seemed to run fine on workbench

检索 strigied json 数据的查询:

select count(*) from ABC 
where NOT(StoredFileLinks = '[]' or StoredFileLinks LIKE %xtractedImages\": []%') 
and NOT(Response LIKE 'Unable to detect%' or Response LIKE 'Your device is not%');

似乎无法理解错误在哪里。它说:

pandas.io.sql.DatabaseError: Execution failed on sql 'select count(*) from ABC where NOT(StoredFileLinks = '[]' or StoredFileLinks LIKE %xtractedImages": []%') and NOT(Response LIKE 'Unable to detect%' or Response LIKE 'Your device is not%');': (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'%xtractedImages": []%\') and NOT(Response LIKE \'Unable to detect%\' or Response LI\' at line 1')

使用 V8.04 在 MySQL workbench 上运行相同的查询。此查询正在 ubuntu 服务器中使用,其 mysql 版本为 14.14。

哪里出错了?

您的第一个 like 条件构造不正确。

select count(*) from ABC 
where not(StoredFileLinks = '[]' or StoredFileLinks like '%xtractedImages": []%') 
and not(Response LIKE 'Unable to detect%' or Response like 'Your device is not%');