title: zend select query inside joinleft
body: <p>How to write SELECT query inside JOIN LEFT in a Zend model?
  for eg how to convert the following mysql query to zend model query</p>
  
  <pre><code>    LEFT JOIN 
      (SELECT count(*) as game_count,topic_id,time as g_time from games_list WHERE type &lt; 3 GROUP BY topic_id) t3
      ON chapter_list.id=t3.topic_id
  </code></pre>
  
  <p>I want to add converted query with the following zend query and I need game_count from the above query with the following result.</p>
  
  <pre><code>    $query = $this-&gt;select()
  
      -&gt;setIntegrityCheck(false)
  
      -&gt;from(array('a' =&gt; 'chapter_list'), array('subtopic_id as topic','id as topic_id','grade','chapter_no as chapter','if(file_status=1,1,0) as ppt)','CONCAT("http://mysite.com?t=",subtopic_id) as link'))
  
      -&gt;joinLeft(array('b' =&gt; 'subject_list'), 'a.subject = b.subject_id', array());
  
      return $this-&gt;fetchAll($query)-&gt;toArray();
  </code></pre>