In article <[EMAIL PROTECTED]>,
"Graham Cossey" <[EMAIL PROTECTED]> writes:
> I'm hoping someone can help with a little problem I'm having with a query.
> In the query below I wish to return as least one row per tbl1, however I am
> only getting rows where there is at least an entry for tbl2 :
>
lists.mysql.com
> Subject: RE: Help with a query using multiple LEFT JOINS
>
>
> If you mean that you want to get a row even if tbl2 does not have
> a matching
> row for dcode, then move the conditions into the ON clause.
>
> Example based off of what you had:
>
> SELE
If you mean that you want to get a row even if tbl2 does not have a matching
row for dcode, then move the conditions into the ON clause.
Example based off of what you had:
SELECT
FROM tbl1 as d
LEFT JOIN tbl2 as r ON (d.dcode=r.dcode AND r.mcode='AB' AND r.year=2004 AND
r.month IN (1,2,3,4,5,6,7,