title: Mysql join query help to show 2 seperate records
body: <p>I have this query which returns the courses which has <code>status = "offering"</code> and <code>offered by that user</code> who also has a course with the <code>courseid "3"</code> now the <strong>problem</strong> is that       </p>
  
  <p>There is a sc_c_material table that has 2 records against a course i want to show 2 seperate rows against this, where 1 row has sc_course data with 1st record of sc_c_material and 2nd row again with sc_course data with 2nd record of sc_c_material</p>
  
  <p>The below query <code>only return 1 record</code> for the course which has <code>id 9</code> where <code>id 9</code> has <code>2 records</code> in <code>sc_c_materials</code> table. i want both of those record from <code>sc_c_material</code> table</p>
  
  <p>I hope I have cleared my point, because it was a bit hard to explain</p>
  
  <pre><code>SELECT c.`id`,
       c.`coursecode`,
       m.`title`,
       a.`author_name`,
       q.`quality`,
       m.`comments`,
       s.status,
       u.id,
       m.`material`
  FROM sc_courses c,
       sc_status s,
       sc_c_materials m, 
       sc_authors a,
       sc_quality q,
       users u
  WHERE c.`statusid`=s.`id`
      AND c.`userid`=u.`id`
      AND m.`qualityid`=q.`id`
      AND m.`authorid`=a.`id`
      AND c.`id`=m.`courseid`
      AND s.`status`="offering"
      AND c.`userid` IN (SELECT userid 
                  FROM sc_courses 
                  WHERE id="3" 
                  GROUP BY userid)
  </code></pre>