我想獲得使用yii後面的sql語句的幾個結果,但有一些錯誤.... !!!我可以使用yii CSqlDataProvider執行兩個或多個sql語句嗎?
$sql="SET @pStat=-1; SET @pdt=0; SELECT * FROM (SELECT !li.gen AS id,li.logAt, getDuration(gen,logAt) AS duration FROM os_loggerinfo li) AS a WHERE a.duration>0;";
$count=count(Yii::app()->db->createCommand($sql)->query());
$dataProvider=new CSqlDataProvider($sql, array(
'totalItemCount'=>$count,
'pagination'=>array(
'pageSize'=> 10,
),
));