MySQL выдает ошибку в запросе, который, кажется, нормально работает на верстаке - PullRequest
0 голосов
/ 15 января 2020

Запрос, который возвращает стригированные 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')

Тот же запрос выполняется на MySQL верстаке с V8.04. Этот запрос используется на сервере Ubuntu, чья версия mysql равна 14.14.

Где ошибка l ie?

1 Ответ

1 голос
/ 15 января 2020

ваше первое 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%');
...