检索分层的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服务器中使用。

错误在哪里?

最佳答案

您的第一个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%');

关于mysql - MySQL在工作台上运行正常的查询中给出错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/59747860/

10-16 19:52