title: SQL Group by one column, count entries in another
body: <p>I'm using a sqlite3 database, with a table like this.</p>
  
  <pre><code>|name   |action     |
  -------------------------
  |john   |run        |
  |jim    |run        |
  |john   |run        |
  |john   |jump       |
  |jim    |jump       |
  |jim    |jump       |
  |jim    |dive       |
  </code></pre>
  
  <p>I want to get an output like this</p>
  
  <pre><code>|name   |run    |jump   |dive   |
  ---------------------------------
  |john   |2  |1  |0  |
  |jim    |1  |2  |1  |
  </code></pre>
  
  <p>The closest I've come is with this, but I would like to have a single row like above.</p>
  
  <pre><code>SELECT name, action, COUNT(name)
  FROM table
  GROUP BY name, action
  
  |name   |action |COUNT(name)    |
  |john   |run    |2      |
  |john   |jump   |1      |
  |jim    |run    |1      |
  |jim    |jump   |2      |
  |jim    |dive   |1      |
  </code></pre>
  
  <p>Also, I will need to have some WHERE statements in the query as well.</p>
  
  <p>Am I up in the night thinking this will work?</p>