title: In MySQL how do I count messages from a user?
body: <p>I have tables as below.</p>
  
  <p>Table <strong>Messages</strong></p>
  
  <pre><code>message_id
  parent_id
  forum_id
  user_id
  </code></pre>
  
  <p>Table <strong>Users</strong></p>
  
  <pre><code>user_id
  username
  pass
  </code></pre>
  
  <p>How to query a user, and display the count of their messages with their username?</p>
  
  <p>My query:</p>
  
  <p><code>select count(subject), user_id from messages group by user_id;</code></p>
  
  <p>The problem is that it only displays user_id and count of messages but no username.  How do I make it display the name of the user?</p>