MySQL 14.14版本为在8.03版本上运行良好的查询提供了错误

问题描述 投票:0回答:1

检索分层的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工作台上运行。此查询正在mysql版本为14.14的ubuntu服务器中使用。

错误在哪里?

mysql mysql-workbench mysql-error-1064
1个回答
0
投票

您的第一个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%');
© www.soinside.com 2019 - 2024. All rights reserved.