I want write a Following Query in Active record .
SELECT * FROM `User` WHERE `UserId` IN ( 6, 7, 8, 9 ) ;
Thanks
Either you can use addInCondition or you can also use compare method.
$criteria = new CDbCriteria(); $criteria->compare('UserId',array(6,7,8,9)); $userDataObj = User::model()->findAll($criteria);