Am Freitag, 8. Juli 2005 03:22 schrieb Paul McGarry:
> When I do that I lose all the rows whose grp isn't in both tables. For
> example: ======
> SELECT grp, count(goodamount), sum(goodamount), count(badamount),
> sum(badamount) FROM lefty FULL OUTER JOIN righty USING (grp)
> WHERE lefty.day >= '2005-06-01' AND righty.day>='2005-06-01'
> GROUP BY grp;
You need to write ... WHERE (lefty.day >= '2005-06-01' OR lefty.day IS NULL)
AND etc.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/