List:General Discussion« Previous MessageNext Message »
From:Gary Smith Date:December 10 2009 3:39pm
Subject:Re: Multiple joins from same table?
View as plain text  
Terry Van de Velde wrote:
> Good Day,
>
>  
>
> I am attempting to do something new (to me) with MySQL. I am looking to have
> my query return with the value in the visitor and home columns replaced with
> the corresponding team name from the teams table.  schedule.visitor and
> schedule.home are essentially foreign keys to teams.team_no (though I have
> not defined them as such yet). What I have been trying is the select
> statement below which is fine when joining using one team (say the home
> team), but as soon as I attempt to add in the visitor team, things fall
> apart.
>
>   
select * from table as t1,table as t2,table as t3 where 
t1.column1='blah' and t2.column2='blah' and t3.column3='blah'

does the same thing as

select * from table where column1='blah' and column2='blah' and 
column3='blah'

Does that do what you're after?

Gary
Thread
Multiple joins from same table?Terry Van de Velde10 Dec
  • Re: Multiple joins from same table?Gary Smith10 Dec
  • Re: Multiple joins from same table?Shawn Green12 Dec
    • RE: Multiple joins from same table?Terry Van de Velde13 Dec