title: Avoiding Cartesian Product with Inner Joins
body: <p>I know this has been asked before, but I'm having difficulty in grasping it.  I rarely use raw SQL.<br>
  I have three tables - <code>Session</code>, <code>GroupName</code> and <code>GroupSessionFeedback</code>.</p>
  
  <p>I'm joining <code>Session</code> to <code>GroupFeedback</code> on <code>idUser</code>
  and I'm joining <code>GroupName</code> to <code>Session</code> on <code>idGroup</code> column.</p>
  
  <p>Here's my SQL code:</p>
  
  <pre><code>SELECT s.idSession, 
         g.name, 
         s.Assistant, 
         s.idGroup, 
         s.start, 
         s.end, 
         f.value
    FROM rempad.Session s
   INNER JOIN rempad.GroupSessionFeedback f
      ON s.idUser = f.idUser
   INNER JOIN rempad.GroupName g
      ON s.idGroup = g.idGroup
   WHERE s.start BETWEEN '2013-04-28' AND '2013-05-28'
     AND s.idUser = 22
      OR s.idUser = 23
      OR s.idUser = 24
      OR s.idUser = 26
      OR s.idUser = 27
      OR s.idUser = 28
      OR s.idUser = 42;
  </code></pre>
  
  <p>I want it to bring back unique <code>idSessions</code> but it is matching it multiple times because of the Joins and I really haven't an idea what other approach to take.  I could make separate calls to the database - but I'm really trying to avoid hammering the database as it's pretty slow response as it is.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance</p>