title: SQL: Syntax error with intersect?
body: <p>This is my query:</p>
  
  <pre><code>-- Sids of suppliers who supply a green part AND a red part
  (SELECT Suppliers.sid
  FROM Suppliers
  JOIN Catalog ON Catalog.sid = Suppliers.sid
  JOIN Parts ON Parts.pid = Catalog.pid
  WHERE Parts.color = "red")
  INTERSECT
  (SELECT Suppliers.sid
  FROM Suppliers
  JOIN Catalog ON Catalog.sid = Suppliers.sid
  JOIN Parts ON Parts.pid = Catalog.pid
  WHERE Parts.color = "green");
  </code></pre>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>ERROR 1064 (42000): You have an error
    in your SQL syntax; check the manual
    that corresponds to your MySQL server
    version for the right syntax to use
    near 
        "INTERSECT 
        (SELECT Suppliers.sid
        FROM Suppliers
        JOIN Catalog ON Catalog.sid = Sup" on line 6.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p>This is the schema:</p>
  
  <p>Suppliers(<strong>sid: integer</strong>, sname: string, address string)</p>
  
  <p>Parts(<strong>pid: integer</strong>, pname: string, color: string)</p>
  
  <p>Catalog(<strong>sid: integer, pid: integer</strong>, cost: real)</p>
  
  <p><strong>bold</strong> = primary key</p>