title: How to fetch values likes PDO::FETCH_COLUMN in Doctrine?
body: <p>I have the following code:</p>
  
  <pre><code>$repository = $this-&gt;entitymanager-&gt;getRepository('Intlist\Entity\Location');
  $query = $repository-&gt;createQueryBuilder('l')
      -&gt;select('l.country')
      -&gt;groupBy('l.country')
      -&gt;where('l.country != :empty_country')
      -&gt;setParameter('empty_country', "")
      -&gt;getQuery();
  </code></pre>
  
  <p>And I would like to obtain something like <code>[ 'EN', 'FR', 'US' ]</code>, like <code>PDO::FETCH_COLUMN</code> would return. I tried <code>getScalarResult()</code> but it returns the same result as <code>getArrayResult()</code>:</p>
  
  <pre><code>array (size=2)
    0 =&gt; 
      array (size=1)
        'country' =&gt; string 'DE' (length=2)
    1 =&gt; 
      array (size=1)
        'country' =&gt; string 'MM' (length=2)
  </code></pre>
  
  <p>I tried to use <code>execute()</code> as I have seen on some examples but it returns the same result as <code>getArrayResult()</code> and not a PDO statement.</p>
  
  <p>Any idea?</p>