Why does PostgreSQL not return null values when the condition is <> true

后端 未结 3 1688
遥遥无期
遥遥无期 2020-12-16 11:53

I was confused behind the reasoning of the following:

SELECT * FROM table WHERE avalue is null

Returns x number of rows where \'avalue\' is

3条回答
  •  无人及你
    2020-12-16 12:28

    This link provides a useful insight. Effectively as @Damien_The_Unbeliever points out, it uses Three-valued logic and seems to be (according to the article) the subject of debate.

    A couple of other good links can be found here and here.

    I think it boils down to null not being a value, but a place holder for a value and a decision had to be made and this was it... so NULL is not equal to any value because it isn't a value and won't even not be equal to any value.... if that makes sense.

提交回复
热议问题