title: How to use subquery as FROM in DQL
body: <p>im using Zend Framwork 3 and Doctrine 2. I got a relatively complex DQL with multiple joins having and where clauses. </p>
  
  <p>I now need to get some rowcounts for those queries with different paramters in the having clause. I thought a <code>SELECT COUNT(*) FROM (original-query) AS c</code> would be the easiest way to do so. But when trying to use a native query i get Problems with binding the paramters from the DQL to the native query and when trying to do sth. like </p>
  
  <pre><code>$queryBuilder-&gt;select('count(c)')-&gt;from('('.$originalQuery-&gt;getDQL().')', 'c');
  </code></pre>
  
  <p>i get :</p>
  
  <pre><code>Error: Class '(' is not defined.
  </code></pre>