title: How to perform an INTERSECT query in Access SQL
body: <p>I have this Python snippet for querying SQLite tables 'note', 'tag', and the many-to-many join table 'fkeys'. Very procedural I guess, but it works. Now I want to do a similar thing in Access but Jet SQL does not support <code>INTERSECT</code>. </p>
  
  <p>I have been trying code from similar posts here for a few hours. None of the <code>WHERE EXISTS</code> or <code>GROUP BY ... HAVING</code> + subquery stuff works.
  SQL-92 option didn't help either. Can this be done in Jet SQL?</p>
  
  <pre><code>  db.execute('SELECT DISTINCT n.rowid as rowid, n.note_txt as note_txt,\
    date(n.timestamp) as timestamp\
    FROM note n\
    JOIN fkeys f\
    ON n.rowid = f.note_id\
    JOIN tag t\
    ON t.rowid = f.tag_id\
    WHERE t.tag_text = ?\
  INTERSECT  \
    SELECT DISTINCT n.rowid as rowid, n.note_txt as note_txt,\
    date(n.timestamp) as timestamp\
    FROM note n\
    JOIN fkeys f\
    ON n.rowid = f.note_id\
    JOIN tag t\
    ON t.rowid = f.tag_id\
    WHERE t.tag_text = ?\
  INTERSECT\
    SELECT DISTINCT n.rowid as rowid, n.note_txt as note_txt,\
    date(n.timestamp) as timestamp\
    FROM note n\
    JOIN fkeys f\
    ON n.rowid = f.note_id\
    JOIN tag t\
    ON t.rowid = f.tag_id\
    WHERE t.tag_text = ?\
    ORDER BY timestamp',[srchtxt0,srchtxt1,srchtxt2])
  </code></pre>