title: mysql sql distinct with join two table
body: <p>I have two mysql table , table <code>event</code> and table <code>eventvenue</code>.</p>
  
  <p>I want to get other event from a venue.</p>
  
  <p>--------------table <code>event</code>:---------------</p>
  
  <pre><code>id_e
  id_event
  title
  content
  </code></pre>
  
  <p>-------------- table <code>eventvenue</code>:--------------</p>
  
  <pre><code>id_ev
  id_event_ev
  id_location_ev
  </code></pre>
  
  <p>I use join to get other event from a venue:</p>
  
  <pre><code>SELECT * 
  FROM eventvenue 
  JOIN event ON eventvenue.id_event_ev = event.id_event 
  WHERE eventvenue.id_location_ev=1
  </code></pre>
  
  <p>The result is:</p>
  
  <pre>
  id_ev  id_event_ev  id_location_ev  id_e  id_event  title   content  
  -----  -----------  --------------  ----  --------  ------  ------------
  1      2            1               2     2         eventA  aaaaaaaaaaaa
  2      2            1               2     2         eventA  aaaaaaaaaaaa
  1      4            1               4     4         eventB  bbbbbbbbb
  1      9            1               9     9         eventC  cccccccc
  3      5            1               5     5         event5  555555
  </pre>
  
  <p>The output contains two rows with the same <code>id_event_ev</code>/<code>id_event</code> value of <code>2</code>.</p>
  
  <p>How can I show only <strong>distinct</strong> event IDs per location? Like this:</p>
  
  <pre>
  id_ev  id_event_ev  id_location_ev  id_e  id_event  title   content  
  -----  -----------  --------------  ----  --------  ------  ------------
  1      2            1               2     2         eventA  aaaaaaaaaaaa
  1      4            1               4     4         eventB  bbbbbbbbb
  1      9            1               9     9         eventC  cccccccc
  3      5            1               5     5         event5  555555
  </pre>
  
  <p>Note: <code>id_ev</code> is not important.</p>