title: Grouping by two values in same table
body: <p>I have a table on the format</p>
  
  <pre><code>Ship_type | userid | Message
  </code></pre>
  
  <p>Neither of these columns are unique.
  I want to count how many (unique) user id's that belong to each ship type, and thus find out which ship type is the most popular.</p>
  
  <p>Example:</p>
  
  <pre><code>Ship_type     | userid| Message
  -------------- ------- ----------
  Sailboat      | 34241 | hello
  Sailboat      | 34241 | hi
  Sailboat      | 34241 | I'm on a boat!
  Fishingvessel | 31245 | yo
  Fishingvessel | 98435 | hi there
  </code></pre>
  
  <p>Here we see that there are two different fishingvessels and one sailboat.</p>
  
  <p>If I do the following query:</p>
  
  <pre><code> select ship_type, count(ship_type) FROM db1.MessageType5 GROUP BY ship_type ORDER BY count(ship_type) ASC;
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Sailboat      | 3
  Fishingvessel | 2
  </code></pre>
  
  <p>which is wrong - as it counts the number of messages belonging to each ship_type. </p>
  
  <p><strong>Desired result:</strong></p>
  
  <pre><code>Fishingvessel | 2
  Sailboat      | 1
  </code></pre>