List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 19 2003 6:23pm
Subject:RE: SQL Count Query
View as plain text  
At 10:18 -0700 1/19/03, Jeff Donnici wrote:
>  > That would work, but it's not necessary.  He should use a
>>  LEFT JOIN, which will produce a row in the output for the
>>  left table, whether or not any right table rows match it. 
>>  The syntax is in the MySQL manual.
>I appreciate the pointer to LEFT JOIN and have read through the site's
>documentation on it. Unfortunately, I don't see how that will help me
>get the non-existent dates in there with a count of 0. As Nasser pointed
>out, there's nothing to do if no rows for those dates exist. In the case
>of using a LEFT JOIN, I don't get what I'd be joining my table to...
>Sorry for being dense, but any help you can provide is most appreciated.

Ah, yeah.  Okay, that's right.  So then you *will* need to do it
programmatically ... OR ... create a reference table that lists
each of the dates in which you're interested.  Then do a  LEFT JOIN
against that.


SQL Count QueryJefferey Donnici19 Jan
  • Re: SQL Count QueryHarald Fuchs19 Jan
Re:SQL Count QueryNasser Ossareh19 Jan
  • Re:SQL Count QueryPaul DuBois19 Jan
    • Re: Re:SQL Count QueryAdolfo Bello19 Jan
    • RE: SQL Count QueryJeff Donnici19 Jan
      • RE: SQL Count QueryPaul DuBois19 Jan
Re: SQL Count QueryJeff Donnici19 Jan
RE: SQL Count QueryJeff Donnici19 Jan