title: Different outputs from same GROUP BY SQL statement
body: <p>I have tried running two SQL queries which are basically the same but only differ in terms of the GROUP BY. To make it clearer, the following are my queries. </p>
  
  <p>First query:</p>
  
  <pre><code>SELECT EXTRACT(YEAR FROM tarikh_lulus) AS Tahun, COUNT(*) AS Jumlah 
  FROM association 
  GROUP BY Tahun
  </code></pre>
  
  <p>The first query gave me the following result</p>
  
  <pre><code>Tahun   Jumlah
  0   60
  0   1464
  5   1
  6   2
  7   1
  8   2
  1970    3
  1998    431
  1999    206
  2000    77
  2001    97
  2002    104
  2003    123
  2004    59
  2005    1
  2006    8
  2007    162
  2008    173
  2009    498
  2010    620
  2011    915
  2012    911
  2013    602
  </code></pre>
  
  <p>The second query :</p>
  
  <pre><code>SELECT EXTRACT(YEAR FROM tarikh_lulus) AS Tahun, COUNT(*) AS Jumlah 
  FROM association 
  GROUP BY tarikh_lulus
  </code></pre>
  
  <p>The second query gave the following:</p>
  
  <pre><code>Tahun   Jumlah
  0   60
  1970    3
  1998    16
  1998    1
  1998    36
  1998    1
  1999    8
  1999    14
  1999    3
  1999    12
  2000    1
  2000    5
  2001    4
  2001    1
  2001    7
  2002    3
  2002    2
  2002    1
  2002    3
  2003    7
  2003    3
  2003    1
  2004    1
  2005    1
  2007    1
  2007    1
  2007    2
  2007    1
  2008    1
  2008    2
  2008    1
  2008    11
  2009    1
  2009    26
  2009    4
  2010    47
  2010    71
  2010    6
  2010    52
  2010    1
  2011    7
  2011    32
  2011    10
  2011    15
  2011    1
  2011    1
  2011    38
  ...
  </code></pre>
  
  <p>Why is it that the results are different? As far as I can understand it is grouped by the same column? </p>