$criteria = new CDbCriteria(); $criteria->addInCondition('status', array('active', 'inactive', 'pending'));
$subquery = User::model()->find(array( 'select' => 'id', 'condition' => 'role = :role', 'params' => array(':role' => 'admin'), )); $criteria = new CDbCriteria(); $criteria->addInCondition('user_id', $subquery);These examples use the Yii framework's implementation of CDbCriteria and therefore belong to the Yii library package.