gpt4 book ai didi

mysql - ER_PARSE_ERROR : check the manual that corresponds to your MySQL server version for the right syntax to use near '== false

转载 作者:行者123 更新时间:2023-11-29 18:03:38 24 4
gpt4 key购买 nike

我想检查复选框值 true 或 false 以及我的查询,如下所示,但我在这里收到错误。请帮我解决这个问题。它正在接近复选框值

    sql = `
SELECT data
FROM Job
WHERE (? IS NULL OR
JSON_EXTRACT(data, '$.address') LIKE ? OR
JSON_EXTRACT(data, '$.customerJobNumber') = ? OR
JSON_EXTRACT(data, '$.jobId') = ? ) AND
(JSON_EXTRACT(data, '$.jobDate') IS NULL OR JSON_EXTRACT(data, '$.jobDate') <= ?)
AND JSON_EXTRACT(data,'$.checkBoxValue')== false
AND JSON_EXTRACT(data, '$.status') NOT IN (?) `

最佳答案

就像之前的条件一样,您应该只使用一个 =。此外,JSON_EXTRACT 的值将是一个字符串,因此您应该将其与字符串进行比较:

AND JSON_EXTRACT(data, '$.checkBoxValue') = 'false'

关于mysql - ER_PARSE_ERROR : check the manual that corresponds to your MySQL server version for the right syntax to use near '== false,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48109453/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com