title: How can I select specific Columns with createQueryBuilder in Doctrine ORM?
body: <p>I'm using Doctrine <code>createQueryBuilder()</code> to construct queries in Symfony2. But, I don't want to take all columns in this entity. How can I select only the ID and Name?</p>
  
  <pre><code>$query = $this-&gt;getEntityManager()-&gt;createQueryBuilder();
          $query
              -&gt;select('d')
              -&gt;from('AcmeBundle:Demo', 'd')
              -&gt;leftjoin('d.otherEntity', 'o');
  
          $query-&gt;setMaxResults(10);
          $results = $query-&gt;getQuery()-&gt;getResult();
  </code></pre>
  
  <p>Thank you so much,</p>