title: How to get the equivalent using join
body: <p>I have two tables :</p>
  
  <p><strong>fields_col</strong></p>
  
  <pre><code>---------------------
  | id |   type_field |
  ---------------------
  | 1  |    login     |
  | 2  |    password  |
  | 3  |    login     |
  | 4  |    password  |
  </code></pre>
  
  <p><strong>value_field</strong></p>
  
  <pre><code>----------------------------------
  | id | typefieldid | value_field |
  ----------------------------------
  | 1  |      1      |     joe     |
  | 2  |      1      |     doe     |
  | 3  |      4      |     car     |
  | 4  |      3      |     dom     |
  | 5  |      2      |     he6     |
  | 6  |      2      |     abc     |
  | 7  |      3      |     iph     |
  | 8  |      1      |     nan     |
  | 9  |      4      |     no9     |
  </code></pre>
  
  <p>I expect to get all values where the type is <code>login</code>.
  Here is the expected output : </p>
  
  <pre><code>joe
  doe
  dom
  iph
  nan
  </code></pre>
  
  <p>I made up the following query :</p>
  
  <pre><code>SELECT value_field 
  FROM value_field
  WHERE typefieldid IN (SELECT id FROM fields_col WHERE type_field = "login")
  </code></pre>
  
  <p>And it output me the correct value.</p>
  
  <p>I wonder how to use SQL join feature in this case.</p>
  
  <p><a href="http://sqlfiddle.com/#!9/801bc/2/0" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/801bc/2/0</a></p>