Example of three valued logic in SQL Server

后端 未结 5 1006
难免孤独
难免孤独 2020-12-16 05:02

I understand that SQL uses three valued logic but I am having trouble understanding how to use this in practice, especially why TRUE || NULL = True and FA

5条回答
  •  伪装坚强ぢ
    2020-12-16 05:25

    True && NULL is neither True or False. It's just NULL.

    Whether that will evaluate as True, False, or an Error in a boolean expression depends on what happens on your system when you evaluate NULL by itself as a boolean. Sql Server will do everything it can to avoid choosing, but when forced you'll pretty much never see a positive (True) result.

提交回复
热议问题