title: MySQL How Can I Group By With A Wildcard
body: <p>I'm trying to write a MySQL query to group rows together with a wildcard. Is this possible?</p>
  
  <p>My table has the following rows:</p>
  
  <pre><code>   Region
  </code></pre>
  
  <ol>
  <li>South </li>
  <li>South: Miami </li>
  <li>South: Miami: Miami Beach </li>
  <li>South: Miami </li>
  <li>South</li>
  <li>South: Miami: Miami Beach </li>
  <li>South </li>
  <li>South: Miami</li>
  </ol>
  
  <p>Currently using the following query:</p>
  
  <pre><code>SELECT `region`, count(*) as `TOTAL` FROM `table` WHERE 1=1  group by `region`
  </code></pre>
  
  <p>Which gives the following output:
        Region                       Total</p>
  
  <pre><code> 1. South                            3
   2. South: Miami                     3
   3. South: Miami: Miami Beach        2
  </code></pre>
  
  <p>How can I adjust the query to give the followinng output?</p>
  
  <pre><code> Region                       Total
  
   1. South                            8
   2. South: Miami                     5
   3. South: Miami: Miami Beach        2
  </code></pre>
  
  <p>Thanks for your help.</p>