MySQL Forums
Forum List  »  PHP

Re: Mutual Matches
Posted by: Bill Karwin
Date: April 21, 2006 05:12PM

Does this do what you want?

SELECT y.*
FROM favorites AS x INNER JOIN favorites AS y ON x.userFav = y.userID AND y.userFav = x.userID

I'm not sure why you need favID in that table. I would define a compound primary key over the two columns (userID, userFav).

Regards,
Bill K.

Options: ReplyQuote


Subject
Written By
Posted
April 21, 2006 04:22PM
Re: Mutual Matches
April 21, 2006 05:12PM
April 21, 2006 05:29PM
April 21, 2006 06:42PM
April 23, 2006 12:01PM


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.