title: SQL: Join Parent - Child tables
body: <p>I'm building a simple review website application and need some help with SQL Query. </p>
  
  <p>There are 3 tables (Topics, Comments, Users).  I need a SQL query to select the data from all 3 tables.</p>
  
  <p>The 'Topics' table is the parent and the 'Comments' table contains the child records (anywhere from zero to 100 records per parent.</p>
  
  <p>The third table 'Users' contains the user information for all users.</p>
  
  <p>Here are the fields for the 3 tables:</p>
  
  <pre><code>Topics (topicID, strTopic, userID)
  Comments (commentID, topicID, strComment, userID)
  Users (userID, userName)
  </code></pre>
  
  <p>I tried: </p>
  
  <pre><code>SELECT * 
  FROM   Topics 
    Inner Join Comments ON Topics.topicID = Comments.topicID
    Inner Join Users ON Topics.userID = Users.userID
  </code></pre>
  
  <p>But this does not work correctly because there are multiple topics and the User info is not joined to the Comments table. Any help would be appreciated.</p>