title: how to create criteria with join in yii
body: <p>I have to tables, one is <code>profile</code> and the other is <code>rating</code>. 
  <code>rating</code> has a field <code>profileid</code> which is primary key to <code>profile.id</code> and a field with rating values. Now I want to find the field with highest rating and display the corresponding profile. Since I'm new to YII framework I'm having troubles with it. Please help me getting out of it. What I'm doing is described below.</p>
  
  <pre><code>$topRage=new CDbCriteria();
  $topRage-&gt;select="*";
  $topRage-&gt;alias="t1";
  $topRage-&gt;order="rateing DESC";
  $topRage-&gt;join="JOIN `ratings` ON `profile`.`id` = `t1`.`profileId`";
  $topRage-&gt;limit="1";
  </code></pre>