title: How do I select and group by a portion of a string?
body: <p>Given I have data like the following, how can I select and group by portions of a string?</p>
  
  <pre><code>Version  Users
  1.1.1    1
  1.1.23   3
  1.1.45   1
  2.1.24   3
  2.1.12   1
  2.1.45   3
  3.1.10   1
  3.1.23   3
  </code></pre>
  
  <p>What I want is to sum up the users using version 1.1.x and 2.2.x and 3.3.x etc, but I'm not sure how I can group on a partial string in a select statement.</p>
  
  <p><strong>edit</strong>
  What the data should return like is this:</p>
  
  <pre><code>Version  Users
  1.1.XX   5
  2.1.XX   7
  3.1.XX   4
  </code></pre>
  
  <p>There is an infinite variable number of versions, some are in this format (major, minor, build) some are just major, minor and some are just major, the only time I want to "roll up" the versions is when there is a build.</p>