title: SELECT multiple values to the same key in multiple tables
body: <p>I have two tables in the following structure</p>
  
  <p><strong>table_1</strong>  </p>
  
  <pre><code>uid | name | age
  1   | John | 24
  2   | Adam | 35
  3   | Sara | 26
  </code></pre>
  
  <p><strong>table_2</strong></p>
  
  <pre><code>id | uid | meta_key | meta_value
  1  | 2   | location | NY
  2  | 2   | school   | NYU
  3  | 3   | Location | NY
  4  | 3   | school   | XYZ
  6  | 1   | location | NY
  6  | 1   | school   | NYU
  </code></pre>
  
  <p>What I am trying to do is to select the users from table_1 where their location is NY and school is NYU</p>
  
  <p>here is the query I tried using with no luck</p>
  
  <pre><code>SELECT
    tabl_1.uid
  FROM `tabl_1`, `tabl_2`
  WHERE
    tabl_1.uid = tabl_2.uid
    AND table_2.meta_key IN ('location', 'school')
    AND table_2.meta_value IN ('NY', 'NYU')
  ORDER BY tabl_1.uid ASC
  </code></pre>
  
  <p>I have looked everywhere without any luck, if you have a query that works or a link to a solution that would much appreciated, thank you. </p>