You need to restructure your db to break down the many-to-many
relationship between games and officials by adding a linking table
between. This should contain a record for every game/official
combination with just the keys of those tables.
This will simplify your query - use a couple of left joins to join the
tables - and will find any number of linked records.
PT
Andy Green wrote:
> I'm trying to write a query that pulls details on a game record, as well as
> the officials assigned to the game (up to 4 officials may be assigned to
> each game, but that's not always the case).
>
> Game details are in the games table, and assignments are in the
> games_referees table (which I alias as referee,ar1,ar2, and fourth).
>
> Ultimately, I want all the games for a given date, and the referees assigned
> to them.
The php_mysql group is dedicated to learn more about the PHP/MySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/