title: Is there a way to remove the nested query in this type of SQL SELECT?
body: <p>Given this table structure and example data (t3 should not be used in the query, it is only here to show the relation between t1 and t2):</p>
  
  <pre><code>      t1                 t2                         t3
  --------------   -----------------   --------------------------------
  | id | value |   | t1key | t3key |   | id | value                   |
  |  1 |  2008 |   |     3 |     1 |   |  1 | "New intel cpu in 2010" |
  |  2 |  2009 |   |     4 |     1 |   |  2 | "New amd cpu in 2008"   |
  |  3 |  2010 |   |     6 |     1 |   |    |                     ... |
  |  4 | intel |   |     1 |     2 |   --------------------------------
  |  5 |   amd |   |     5 |     2 |
  |  6 |   cpu |   |     6 |     2 |
  |    |   ... |   |       |   ... |
  --------------   -----------------
  </code></pre>
  
  <p>How would you build a SQL query that would satisfy the following:</p>
  
  <pre><code>Given the input for t1.id is the set {6} returns t1.id set {3,4,6,1,5}
  Given the input for t1.id is the set {6,4} returns t1.id set {3,4,6}
  Given the input for t1.id is the set {5,4} returns t1.id set {}
  </code></pre>
  
  <p>and doesn't kill performance when the tables are bigger...?   </p>