title: how to get data from inner join using cdbcriteria in yii?
body: <p>This is my SQL. I want to create a <code>CDbCriteria</code> in Yii.</p>
  
  <pre><code>select us.user_id,u.clientid from user_session us
  inner join user u on u.id=us.user_id
  where us.auth_token='authtoken0000000001'
  </code></pre>
  
  <p>I tried this, but gives the wrong result. I also defined a relation <code>related</code> in my <code>user_session</code> model for this.</p>
  
  <pre><code> $criteria = new CDbCriteria;
   $criteria-&gt;select = "user_id,user.clientid as client_id";
   $criteria-&gt;condition='auth_token="'.$token.'"';
   $clientIdarray = UserSession::model()-&gt;with('related')-&gt;find($criteria);
  </code></pre>