mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-27 12:33:09 +08:00
Added example for IS NOT NULL to query builder guide
This commit is contained in:
@@ -184,6 +184,12 @@ results in this WHERE clause:
|
|||||||
WHERE (`status` IS NULL)
|
WHERE (`status` IS NULL)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you need `IS NOT NULL` you can use the following:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$query->where(['not', ['col' => null]]);
|
||||||
|
```
|
||||||
|
|
||||||
You can also create sub-queries with `Query` objects like the following,
|
You can also create sub-queries with `Query` objects like the following,
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
|||||||
Reference in New Issue
Block a user