Re: [SQL] CTE or Subselect and outer joins not behaving as expected?

2011-10-26 Thread Joel Stevenson
Ah, yes! Thanks for the help. On Oct 25, 2011, at 5:42 AM, Harald Fuchs wrote: > Joel Stevenson writes: > > Your WHERE clause turns the OUTER into an INNER JOIN. Try > > select tally_table.tally_mon, met.datum > from ( > select distinct date_trunc( 'month',

[SQL] CTE or Subselect and outer joins not behaving as expected?

2011-10-24 Thread Joel Stevenson
Hi all, I'm trying to enumerate a list of months between a date in the past and now and display a value from an existing table if there is one for the date or NULL if there isn't. I'm using this SQL to generate the months: select distinct date_trunc( 'month', '2011-06-01'::date + tally_day )::d