title: Error Doctrine Query when Using Group By
body: <p>I'm using Symfony Project 1.4 and Postgresql</p>
  
  <p>I got error query in doctrine using</p>
  
  <pre><code>$q = Doctrine_Query::create()
   -&gt;select("count(sex) as total, sex")
   -&gt;from('Biodata')
   -&gt;groupBy('sex')           
   -&gt;execute();
  </code></pre>
  
  <p>there is always display error like this when debug:</p>
  
  <pre><code>SQLSTATE[42803]: Grouping error: 7 ERROR: column "e.id" must appear in the GROUP BY clause or be used in an aggregate function
  LINE 1: SELECT e.id AS e__id, e.sex AS e__sex, COUNT(e.sex) AS e__0 ...
  ^. Failing Query: "SELECT e.id AS e__id, e.sex AS e__sex, COUNT(e.sex) AS e__0 FROM biodata e GROUP BY e.sex"
  </code></pre>
  
  <p>How to fix it and hide e.id column, is this bugs or need a trick?</p>
  
  <p>Excepted result:</p>
  
  <p><img src="https://i.stack.imgur.com/zsABU.png" alt=""></p>