List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:September 30 2007 3:04pm
Subject:Re: Multi Lookup Table Joins
View as plain text  
Chris W wrote:
> I often find that I have more than one column in a tale that is an 
> integer ID used to join to a lookup table.  If there is only one Join to 
> do it is to do something like this....
> 
> SELECT t.data, l.group
> FROM table t JOIN lookuptable l USING (groupID)
> WHERE whatever
> 
> however if I need to join more than one that syntax wont work because 
> the second join will be trying to join to the first lookup table no the 
> main table.  Is there a way around this or do I need to just do joins 
> using this syntax....
> SELECT x, y, z
> FROM table t, lookupA la, lookupB lb
> WHERE t.aID = a.aID AND t.bID = b.bID
> 
> 
You can use ON clauses and explicitly qualify which table the columns 
are in.
Thread
Multi Lookup Table JoinsChris W30 Sep
  • Re: Multi Lookup Table JoinsBaron Schwartz30 Sep
  • Re: Multi Lookup Table JoinsRob Wultsch30 Sep