IN Operator SQL

后端 未结 7 1551
庸人自扰
庸人自扰 2020-12-11 22:21

I have a table called NUMS with a single column n.
And I fill values 1,2,3,4,5,null in it.

Now a query

SELECT n FROM Nums 
 WHERE n IN (1, 2,         


        
7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 23:13

    null is not returning, although included in IN operator

    Because of the n = NULL evaluation; NULL can't equal NULL. It would need to be handled as n IS NULL (or similar appropriate syntax) to return the NULL row/record.

提交回复
热议问题