On 26-Apr-01 [EMAIL PROTECTED] wrote:
> I have two table I need to join in a query.  The second table needs to be 
> join twice (I think)  to the first.   Details as follows (tables pared
> down)...
> 
> Table games
> gameid
> hometeamid
> guestteamid
> 
> Table team
> teamid
> sponsor
> 
> I want a query to return game.gamid, team.sponsor (hometeam), team.sponsor 
> (guestteam).
> 
> can someone point me in the right direction for this please?
> 

select gameid,home.sponsor,guest.sponsor
from games,team as home,team as guest
where hometeamid=home.teamid and guestteamid=guest.teamid;

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to