I used CSqlDataProvider. I want know,it is possible to write this query using CActivDataProvider or just I must use CSqlDataProvider or CArrayDataProvider?
$sql = 'select *
from (
select * from `table1` WHERE user_id != 1 LIMIT 10
union
select * from `table1` WHERE user_id = 1
) a
left join table2 on a.user_id = table2.id';
$connection=Yii::app()->db;
$sql = 'select *
from (
select * from `table1` WHERE user_id != 1 LIMIT 10
union
select * from `table1` WHERE user_id = 1
) a
left join table2 on a.user_id = table2.id';
$command=$connection->createCommand($sql);
$rawData=$command->query()->readAll();
$provider = new CArrayDataProvider($rawData);