title: condition in criteria in yii framework php
body: <pre><code>$criteria=new CDbCriteria();
  $criteria-&gt;with = array('reviewCount', 'category10', 'category20', 'category30', 'town');
  $criteria-&gt;select = 't.id,business,street,postalCode,contactNo,checkinCount,count(tbl_abc.id) as spcount';
  $criteria-&gt;join = 'left join tbl_abc on t.id=tbl_abc.businessId';
  $criteria-&gt;group = 't.id';
  $criteria-&gt;order = 'spcount DESC';
  $criteria-&gt;condition='spcount&gt;1';
  $bizModel = new CActiveDataProvider(Business::model(), array(
      'criteria' =&gt; $criteria
  ));
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <p><code>Column not found: 1054 Unknown column 'spcount' in 'where clause'</code></p>
  
  <p>If I omit the condition the query works fine &amp; orders businesses by spcount. So how do I rewrite this query such that I get all the businesses whose spcount is greater than 1?</p>