title: How do i build this JOIN statement? Having trouble with conditions
body: <p>Now i JUST started getting into joins, so I'm probably missing some core understanding of it, but here's what I want to do:</p>
  
  <p>I have a table with profiles, and several tables (roles, skills, titles etc) with a profile_id, some unrelated data and a value_id (one-to-one relationship)</p>
  
  <p>The user will input an array of different value_ids, and i want to retrieve the id of all profiles that has a corresponding table with a value_id matching those we retrieve from the user.</p>
  
  <p>Some values in the input are specified to only match against a certain table (roles and industries in this case), and that part is working right now. However what i couldn't do was to check if there's a match in <strong>any</strong> of the relevant tables.</p>
  
  <hr>
  
  <p><strong>I have no idea how to style this block of sql. Sorry.</strong> Edit: It styled itself. Neat.<br>
  In this example i have three values. One (88) is specified to search for a certain role, one is for an industry (128) and the third (73) must match at least one row in a set of tables.</p>
  
  <pre><code>SELECT DISTINCT(profiles.id) as id,  
  FROM profiles  
  INNER JOIN profile_experience_roles r ON(r.profile_id = profiles.id)  
  INNER JOIN profile_experience_industries i ON(i.profile_id = profiles.id)  
  INNER JOIN profile_experience_technology t ON(t.profile_id = profiles.id)  
  INNER JOIN profile_wanted_roles w ON(w.profile_id = profiles.id)  
  INNER JOIN profile_languages l ON(l.profile_id = profiles.id)   
  WHERE r.value_id = 88 AND i.value_id = 128 AND  
  (r.value_id = 73 OR i.value_id = 73 OR t.value_id = 73 OR w.value_id = 73 OR l.value_id = 73)
  </code></pre>
  
  <p>The final line is what's causing issues. Any help is appreciated.</p>
  
  <p>Also, I've never posted here before, so I have no idea what im doing.<br>
  Thanks</p>