gpt4 book ai didi

mysql - SQL IF 语句错误

转载 作者:行者123 更新时间:2023-11-29 03:53:17 27 4
gpt4 key购买 nike

create view Com as
select C.id,
IF(A.agree = null) THEN
0
else A.agree
end if
+
IF(GA.agree = null) THEN
0
else GA.agree
end if
FROM
comments C left join AGREES A on A.id_comment=C.id left join GAGREES GA on GA.id_comment=C.id

此代码有语法错误,我该如何解决?

最佳答案

= null 并不意味着什么。你必须使用 is null

关于mysql - SQL IF 语句错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5391613/

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