title: how to join 2 tables with 'where'
body: <p>i explain my problem.
  I have this tables:</p>
  
  <pre><code>      artist                          artist_pic
  -------------------       ---------------------------------------
  | id | name | age |       | id_artist | picUrl | picDescription |
  -------------------       ---------------------------------------
     |                          /\
     ----------------------------
  </code></pre>
  
  <p>For every artist there are many pics.</p>
  
  <p>this is my query (it works)</p>
  
  <pre><code>SELECT a.*, ai.* 
       FROM artist a INNER JOIN artist_pic ai on ai.id_artist = a.id  
           where ai.id_artist = '" + idArtist + "' and ai.elemento = 'artist'
  </code></pre>
  
  <p>Now i should "add" another table called artist_video </p>
  
  <pre><code>      artist                          artist_video
  -------------------       ---------------------------------------
  | id | name | age |       | id_artist | video| videoDescription |
  -------------------       ---------------------------------------
     |                          /\
     ----------------------------
  </code></pre>
  
  <p>i tried something like this, but i don't get the right records</p>
  
  <pre><code>SELECT a.*, ai.*, av.* 
     FROM artist a 
         INNER JOIN artist_pic ai on ai.id_artist = a.id  
         INNER JOIN artist_video av on av.id_artist = a.id
           where ai.id_artist = 2 and ai.elemento = 'artist' and av.id_artist = 
            2 and av.elemento = 'artist'
  </code></pre>
  
  <p>For example, what i should get is:</p>
  
  <pre><code>michael jackson   Img/5345.jpg     concert      video/5345.avi     concert
  michael jackson   Img/3453.jpg     family       video/2344.avi     family
  </code></pre>
  
  <p>But now i get is this( many times the same record)</p>
  
  <pre><code>michael jackson   Img/5345.jpg     concert      video/5345.avi     concert
  michael jackson   Img/3453.jpg     family       video/2344.avi     family
  michael jackson   Img/5345.jpg     concert      video/5345.avi     concert
  michael jackson   Img/3453.jpg     family       video/2344.avi     family
  michael jackson   Img/5345.jpg     concert      video/5345.avi     concert
  michael jackson   Img/3453.jpg     family       video/2344.avi     family
  michael jackson   Img/5345.jpg     concert      video/5345.avi     concert
  michael jackson   Img/3453.jpg     family       video/2344.avi     family
  michael jackson   Img/5345.jpg     concert      video/5345.avi     concert
  michael jackson   Img/3453.jpg     family       video/2344.avi     family
  </code></pre>