![](/img/trans.png)
[英]FirebaseCloudMessaging : PlatformException (PlatformException(null-error, Host platform returned null value for non-null return value., null, null))
[英]Compare nulll value with non null value SQL
我有如下两列:
A栏 | B栏 |
---|---|
A1 | NULL |
A1 | A1 |
B1 | C1。 |
当我如下查询这些列时:
SELECT A 列,B 列来自表其中 A 列!= B 列
我期待以下结果:
A栏 | B栏 |
---|---|
A1 | NULL |
B1。 | C1 |
但是我的查询只给了我第二行作为结果。
SQL 中的 null 等于未知
它也可以有 A1 作为值,因此如果您检查 A1 是否不是 null,它将不会显示
Null 值不参与相等运算,因为没有可比较的值。
您需要在比较语句中包含对 null 的检查。
SELECT Column A, Column B from table where ISNULL(Column A,0) <> ISNULL(Column B,0)
SELECT * from Table where IFNULL(`Column A`, 'NULL') != IFNULL(`Column B`, 'NULL')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.