title: Format Doctrine SubQuery in PHP
body: <p>I Have this query :</p>
  
  <pre><code>$qb-&gt;select("
      tab.product
      ,round(
          (               
              SELECT COUNT( tab2.price )
  
              FROM Application\Entity\PSRespostas tab2 
  
              WHERE 
                  tab.key = tab2.codkey 
              )
      ,2) as GridPercent
  ");
  </code></pre>
  
  <ul>
  <li>But when i execute it occurs the error:</li>
  </ul>
  
  <blockquote>
    <p>[Syntax Error] line 0, col 266: Error: Expected Literal, got 'SELECT'</p>
  </blockquote>
  
  <p>I tried Without the <strong>ROUND</strong> or any function it works, but i need to do it by <strong><em>SQL query</em></strong>. </p>
  
  <p>it occurs with anyone ? , ask if need more information for the query. :(</p>
  
  <p><strong><em>obs.:</em></strong> i can't do it on <strong>Join</strong> because the query does some <strong>Groups</strong> <strong>By</strong> and more complex functions that do not permit me to use anything else but a SubQuery </p>