MySQL Forums
Forum List  »  Docs

complex SELECT Syntax help
Posted by: Jehan Shaw
Date: February 08, 2005 06:45AM

I have tables:fileds as follows;
competitors:id, nameetc
results:id player1, player2, score1, score2, round

results can be played or unplayed matches, so there may or may not be scores there, however all matches that are to be played will be added to the results table by the administrator.

I want to list all competitors that do not appear in either results.player1 OR results.player2 (and round is $round) I used the following, but it doesn't work.
Any suggestions?

SELECT competitors.*
FROM competitors LEFT JOIN results ON competitors.id=results.player1 AND competitors.id=results.player2
WHERE results.id IS NULL AND results.round=$round

Options: ReplyQuote


Subject
Views
Written By
Posted
complex SELECT Syntax help
4278
February 08, 2005 06:45AM


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.