title: Why does SQL force me to repeat all non-aggregated fields from my SELECT clause in my GROUP BY clause?
body: <p>This has bugged me for a long time.</p>
  <p>99% of the time, the GROUP BY clause is an exact copy of the SELECT clause, minus the aggregate functions (MAX, SUM, etc.).<br />
  This breaks the Don't Repeat Yourself principle.</p>
  <p>When can the GROUP BY clause not contain an exact copy of the SELECT clause minus the aggregate functions?</p>
  <h2>edit</h2>
  <p>I realise that some implementations allow you to have different fields in the GROUP BY than in the SELECT (hence 99%, not 100%), but surely that's a very minor exception?<br />
  Can someone explain what is supposed to be returned if you use different fields?</p>
  <p>Thanks.</p>