所以我有以下查询
Select id, [First], [Last] , [Business] as contactbusiness, (Case When ([Business] != '' or [Business] is not null)
Then [Business] Else 'No Phone Number' END) from contacts
结果看起来像
id First Last contactbusiness (No column name)
2 John Smith
3 Sarah Jane 0411 111 222 0411 111 222
6 John Smith 0411 111 111 0411 111 111
8 NULL No Phone Number
11 Ryan B 08 9999 9999 08 9999 9999
14 David F NULL No Phone Number
我希望记录 2 也显示没有电话号码
如果我将“[Business] is not null”更改为 [Business] != null 那么我会得到正确的结果
id First Last contactbusiness (No column name)
2 John Smith No Phone Number
3 Sarah Jane 0411 111 222 0411 111 222
6 John Smith 0411 111 111 0411 111 111
8 NULL No Phone Number
11 Ryan B 08 9999 9999 08 9999 9999
14 David F NULL No Phone Number
通常你需要使用 is not null 而不是 != null。这里发生了什么?