Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to use "where"-clause for an empty record ?

Hi,

I try to do something like that Model::find(["field = 'NULL'"]);

=> Should return all records where that field is NULL

But there´s no return. I tried several ways but there´s nothing ? Is there another way, that i missed in the docs ??

Thanks



84.4k
Accepted
answer

Try:

Model::find(["field IS NULL"]);

Hack ... that´s it !

Thanks so much ;)