mysql NULL value in where in CLAUSE

前端 未结 4 1430
挽巷
挽巷 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:41

    Maybe this information from the MySQL Reference Manual helps:

    To comply with the SQL standard, IN returns NULL not only if the expression on the left hand side is NULL, but also if no match is found in the list and one of the expressions in the list is NULL.

提交回复
热议问题