MySQL Forums
Forum List  »  Newbie

Re: INTERSECT in MySQL?
Posted by: David Fells
Date: April 04, 2005 12:33PM

You could do an inner join between those two tables and get the same result.

SELECT snum
FROM

(SELECT shipments.snum
FROM shipments NATURAL JOIN parts
WHERE parts.color = 'blue') AS s1

INNER JOIN

(SELECT shipments.snum
FROM shipments NATURAL JOIN parts
WHERE parts.color = 'red') AS s2

ON s1.snum = s2.snum

Options: ReplyQuote


Subject
Written By
Posted
April 04, 2005 11:50AM
Re: INTERSECT in MySQL?
April 04, 2005 12:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.