mysql NULL value in where in CLAUSE

前端 未结 4 1452
挽巷
挽巷 2021-01-04 04:59

how to deal with NULL value in mysql where in CLAUSE

i try like

SELECT * FROM mytable WHERE field IN(1,2,3,NULL)
<         


        
4条回答
  •  轮回少年
    2021-01-04 05:42

    As by my understanding you want to pull every record with 1,2,3 and null value.

    I don't think its possible to put null in the IN operator. Its expects values and null is well.. not a value. So You really have to put the OR with the null to get the desired result.

提交回复
热议问题