Yii Join With Two Subquery, How To Add Params?

Hi all,

My SQL query is not working when used in Yii. I have problem with getting Criteria params and table aliases to work. I want it in AciveRecord class

Here is my SQL query :

SELECT q1.*,q2.totair


      SELECT invmo as invmo1,

      acct as acct,

      SUM(airchg) as airchg_1 

      FROM `ibank`  

      WHERE (invyr=2011) AND (client_id=10) 

      GROUP BY acct,invmo 

      ORDER BY invmo ASC

  ) q1   


           SELECT invmo as invmo2, sum(airchg) as totair

           FROM ibank 

           WHERE (invyr=2011) AND (client_id=10) 

           GROUP BY invmo 

) q2 

ON q1.invmo1=q2.invmo2 ;

Thanks in Advance…!!!

Getting help from this link -