title: INTERSECT in MySQL
body: <p>I have two tables, records and data.  records has multiple fields (firstname, lastname, etc.). Each of these fields is a foreign key for the data table where the actual value is stored.  I need to search on multiple record fields.</p>
  
  <p>Below is an example query using INTERSECT, but I need one that works in MySQL.</p>
  
  <pre><code>SELECT records.id FROM records, data WHERE data.id = records.firstname AND data.value = "john"
  INTERSECT
  SELECT records.id FROM records, data WHERE data.id = records.lastname AND data.value = "smith"
  </code></pre>
  
  <p>Thanks for any help.</p>