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/ ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match