title: Zend Framework - using alias within a nested query results in issues
body: <p>I'm using ZF 1.12 and I'm trying to create the following query:</p>
  
  <pre><code>SELECT table1.*, (select count(t2.id) from table2 as t2) AS count_t2 FROM table1
  </code></pre>
  
  <p>and here's my attempt:</p>
  
  <pre><code>$query = $this-&gt;getDbTable()-&gt;select()
          -&gt;from(array('table1'), array(
              '*',
              'count_t2' =&gt; '(select count(t2.id) from table2 AS t2)'
          ));
  </code></pre>
  
  <p>However, the resulted query is wrong, I believe due to using alias t2:</p>
  
  <pre><code>SELECT `table1`.*, (select count(t2.id) from table2 AS `t2)` FROM `table1`
  </code></pre>
  
  <p>Is there a sollution for using alias within a nested query ?</p>