更新时间:2023-11-13 15:47:28
NULL
值不等于或不等于其他任何值.
NULL
values are not equal or not equal to anything else.
所以column != NULL
和column = NULL
一样总是虚假的
要检查列是否包含NULL
值,您需要使用IS NULL
运算符.
To check if a column contains NULL
value you need to use IS NULL
operator.
在使用laravel db查询生成器的情况下,您可以使用
In case of laravel db query generator you could use
->whereNull('video_of_week_expired')
方法.
PS:如果假定video_of_week_expired
是类似于标志的列,则***将其设置为NOT NULL
并使用0
/1
值,而不是NULL
/1
PS: if video_of_week_expired
is assumed to be a flag-alike column, you better make it NOT NULL
and use 0
/1
values, instead of NULL
/1