title: How to avoid duplicates in sql query across three joined tables
body: <p>I'm getting duplicates when I do two LEFT JOINs to get to the "event_name" in my example below. I get 112 cases with it set up this way. However, if I get rid of the 2 LEFT JOIN lines and run the query, I get the proper 100 records without duplicates. I tried DISTINCT with the code below, but I still get 112 with duplicates.</p>
  
  <pre><code>SELECT "cases"."id", "cases"."date", "cases"."name", "event"."event_name" 
  FROM "cases"
  LEFT JOIN "middle_table" ON "cases"."serial" = "middle_table"."m_serial"
  LEFT JOIN "event" ON "middle_table"."e_serial" = "event"."ev_serial"
  WHERE "cases"."date" BETWEEN '2012-12-11' AND '2012-12-13'
  </code></pre>
  
  <p>How can I specify that I only want the exact 100 cases from "cases", and that I don't want anything from the tables in the joins to produce any more rows?</p>
  
  <p>Thanks!</p>