title: Use group by with substring
body: <p>I have data that looks like the following, where the first six digits are a date and the last four a sequence.  </p>
  
  <pre><code>010219.0013
  010219.0081
  010219.0082
  010319.0063
  010319.0099
  </code></pre>
  
  <p>I simply want to know how many of each sequence are on each date. The statement:</p>
  
  <pre><code>select left(invoice,6) IV from InvData order by IV
  </code></pre>
  
  <p>works exactly as you'd expect.  However this statement:</p>
  
  <pre><code>select invoice IV from InvData order by IV group by IV
  </code></pre>
  
  <p>gives an incorrect syntax error.  Why?</p>