title: How to write complex JOIN query in CDbCriteria Yii Framework
body: <p>I have two tables : <code>product</code> and <code>document</code> and both are in relations with document_id.</p>
  
  <p>Now I want to fetch documents name by <code>product_id</code> from database using Yii CDbCriteria.</p>
  
  <p>Like : </p>
  
  <pre><code>SELECT d.* 
  FROM `document` As d, `product_document` AS p 
  WHERE d.document_id=p.document_id
  AND
  p.product_id=133;
  </code></pre>
  
  <p>I want to write same query but using <code>CDbCriteria</code>. I have tried it but I am getting stuck with its syntax.</p>