How t use CGrifView with custom query

Hi

Is there any way to use CGrifView with a custom query? I have a complex query given bellow :

select a1.user, tot, prov,pend from

[b][i](select user, count() tot from mobile group by user order by count() desc) as a1 left join

(select user, count(*) prov from mobile where cug_status=‘Provisioned’ group by user ) as a2 on a1.user=a2.user

left join

(select user, count(*) pend from mobile where cug_status=‘Pending’ group by user ) as a3 on a1.user=a3.user[/i][/b]

Can i Some how use CgridView to display results, as it is done by admin action of a model. The fields selected in my query are not actual table field, these are selected from another query.

Thanx & Regards

You can use CSqlDataProvider instead of CActiveDataProvider for the gridView.