List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:December 21 1999 9:49pm
Subject:Re: Inner Joins
View as plain text  
In the last episode (Dec 21), Bryan Porter said:
> Is it not possible to join on more than two tables?  My problem is
> this.  I have three tables with the columns 'palletenumber' in them.
> Now, the three tables contain wildly different information (they're
> actually different warehouses.), but entries in the three tables can
> be listed on the same pallete, thus their palletenumber would be the
> same.  Now, I need to get a simple count of how many product is on
> each unique palletenumber.
> 
> I figured an innerjoin with a count(skidnum) would work well, but I
> cannot get MySQL to join on more than two tables, and even on two
> tables it gives me "ambiguous column name 'palletenumber'".

That just means you have 'palletnumber' in multiple tables and mysql
doesn't know which table you're talking about.  Specify the table along
with the fieldname to avoid the problem:

  ... WHERE ... AND table1.palletnumber = table2.palletnumber ...

-- 
	Dan Nelson
	dnelson@stripped
Thread
Inner JoinsBryan Porter22 Dec
  • Re: Inner JoinsDan Nelson22 Dec