I want to use a yii2 query in which I want to check a not equal to condition. I tried like this but it didn\'t give the desired results. How do I do it?
yii2
In addiction to the @tony answer, for those who need to encapsulate a subquery here there's a quick example:
$users = User::find() ->where([ 'not in', 'id', (new Query()) ->select('user_id') ->from(MyTable::tableName()) ->where(['related_id'=>$myRelatedId]) ->all();