当前位置:网站首页>For MySQL= No data equal to null can be found. Solution

For MySQL= No data equal to null can be found. Solution

2022-07-04 21:26:00 monody666

for example , A field has null、“0”、“1” Three , Because the default value is null, Sometimes you need to query null perhaps 0 The data of . If you use it directly xxx != “1”, Only query “0” Of . All need to be written in other ways .

1.xxx IS NULL OR xxx != "1"

2.NOT(xxx <=> "1")

because = Can't compare null,<=> Sure .(<> amount to !=, Can't afford to <=> This kind of inclusion null Comparative effect )

原网站

版权声明
本文为[monody666]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207042032488961.html