I want write a Following Query in Active record .
SELECT * FROM `User` WHERE `UserId` IN ( 6, 7, 8, 9 ) ;
Thanks
You can use CDbCriteria statement:
CDbCriteria
$criteria = new CDbCriteria(); $criteria->addInCondition('userId', array(6,7,8,9)); $result = User::model()->findAll($criteria);