title: Zend_Db join query
body: <p>I am trying to apply join query on 3 tables in Zend_Db.My query is as follow:</p>
  
  <pre><code>$id_array = array("1","2");
  
  $query = $this-&gt;select();
  $query-&gt;from(array('b' =&gt; 'brands'), array('b.brand_id','b.brand_name'))-&gt;where('b.brand_id NOT in (?)', $id_array)-&gt;order('RAND()')-&gt;limit(5);
  $query-&gt;join(array('p' =&gt; 'product'), 'b.brand_id = p.brand_id', array('p.product_id', 'p.product_price'));
  $query-&gt;join(array('pimg' =&gt; 'product_img_map'), 'p.product_id = pimg.product_id', array('pimg.img_location'));
  $query-&gt;setIntegrityCheck(false);
  $resultRows = $this-&gt;fetchAll($query);
  return $resultRows; 
  </code></pre>
  
  <p>In that one brand may have more than one product,but in query I am applying limit to brand table i.e 5. By default it is applied to product also because if one brand having 5 products it is only giving information of one brand.Is there any suggestion on this.
  Thanks.  </p>