List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 13 1999 1:50am
Subject:Re: Join help...
View as plain text  
At 7:33 PM -0500 9/12/99, Robert Covell wrote:
>Could someone help me make the join(left I believe is what I need) for the
>following two tables.
>Desired Result: A list of all the pageAlias's and the count for today
>even if it (the count) doesn't exist.  In the code I would check (count)
>and if it was null (what a left join adds if the row is not there) display
>This is what I have now and I get ERROR 1066: Not unique table/alias:
>select, pageList1.pageAlias from pageDayHitLog1 LEFT JOIN
>pageDayHitLog1 ON where
>YEAR(pageDayHitLog1.hitDate)=YEAR(NOW()) AND
>MONTH(pageDayHitLog1.hitDate)=MONTH(NOW()) AND
>DAYOFMONTH(pageDayHitLog1.hitDate)=DAYOFMONTH(NOW()) and

You have "from tbl_name LEFT JOIN tbl_name" with the same table name
on both sides of the LEFT JOIN.  I suppose you really want the
first pageDayHitLog1 to be pageList1, at least that's what I'd guess
from the rest of the query.

The error message means you have ambiguous table references in the
table list - since you name the same table twice without giving
one of them an alias, the server can't tell what to do.

Paul DuBois, paul@stripped
Join help...Robert Covell13 Sep
  • Re: Join help...Paul DuBois13 Sep