Question : not null in yii2
Answered by : hiramani-pun
$query = new Query;
$query->select('ID, City,State,StudentName') ->from('student') ->where(['IsActive' => 1]) ->andWhere(['not', ['City' => null]]) ->andWhere(['not', ['State' => null]]) ->orderBy(['rand()' => SORT_DESC]) ->limit(10);
Source : https://stackoverflow.com/questions/29796329/how-to-use-not-null-condition-in-yii2 | Last Update : Wed, 10 Aug 22