title: SQL Count Grouping by a sequence of numbers
body: <p>i have a SQL table like this:</p>
  
  <pre><code>id      pNum
  -----   --------
  100     12
  100     13
  100     15
  100     16
  100     17
  200     18
  200     19
  300     20
  300     21
  300     25
  </code></pre>
  
  <p>and i want to group by the id and the pNum sequences, and count the number of rows. having a result like this.</p>
  
  <pre><code>id      res
  -----   --------
  100     2
  100     3
  200     2
  300     2
  300     1
  </code></pre>
  
  <p>any idea on how to do it?</p>