title: How do I do `group by` partial match
body: <p>I have a table in SQL-server with projectcodes and sub-project-codes in the same fields.  </p>
  
  <p>The stucture is something like this</p>
  
  <pre><code>+----+------+-------------+-------+--------+--------+
  | id | date | projectcode | debit | credit | budget |
  +----+------+-------------+-------+--------+--------+
  | 1  | bla  | A100        | bla
  | 2  | bla  | A100.01     |
  | 3  | bla  | A112        |
  | 4  | bla  | A112.02
  </code></pre>
  
  <p>How do I do a select like this</p>
  
  <pre><code>SELECT projectcode
    , sum(debit) as debit
    , sum(credit) as credit
    , sum(budget) as budget
  FROM table1
  GROUP BY -insert-answer-here-
  </code></pre>
  
  <p>I want the output to <code>group by</code> A100 and A100.01 and A100.x together as well as A112 + A112.x</p>
  
  <p>How do I do this?</p>
  
  <p><strong>I have no control over the structure of the table.</strong></p>