mysql中where条件使用不等于(<>)时出现空值被过滤掉的问题
解决方案:通过在条件中使用ifnull函数转化空值来避免空值被过滤掉。
示例:
select
…
from
…
where
ifnull(xxx,’’)<>‘xx’
09-17
1553
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-05
3025
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交