How does 'in' clause works in oracle

前端 未结 5 1591
遇见更好的自我
遇见更好的自我 2020-12-11 04:46
select \'true\' from dual where 1 not in (null,1);

when we execute this which will result nothing

what my question is:

is the above

5条回答
  •  难免孤独
    2020-12-11 04:51

    The issue of your script in comparing with NULL value. You should use

    column is null and column = 1
    

    Actually NULL is an undefined value. Any comparation with NULL gives neither True nor False but NULL. Even NULL = NULL

    That's why your 1 not in (null,1) doesn't work.

提交回复
热议问题