title: MSSQL Group until type is changed
body: <p>I currently have this table:</p>
  
  <pre><code>╔════╦══════════╦════════════╗
  ║ ID ║ PartType ║ PartStatus ║
  ╠════╬══════════╬════════════╣
  ║  1 ║ A        ║ OK         ║
  ║  2 ║ A        ║ BAD        ║
  ║  3 ║ A        ║ OK         ║
  ║  4 ║ A        ║ OK         ║
  ║  5 ║ B        ║ OK         ║
  ║  6 ║ B        ║ BAD        ║
  ║  7 ║ A        ║ OK         ║
  ╚════╩══════════╩════════════╝
  </code></pre>
  
  <p>I want to be able to group them by PartType UNTIL it changes. So it should output like this:</p>
  
  <pre><code>╔══════════╦══════════╗
  ║ PartType ║ Quantity ║
  ╠══════════╬══════════╣
  ║ A        ║        4 ║
  ║ B        ║        2 ║
  ║ A        ║        1 ║
  ╚══════════╩══════════╝
  </code></pre>