Re: [GENERAL] show all record between two date after group by and aggrigation...

2007-01-23 Thread Chad Wagner
On 1/23/07, Jorge Godoy <[EMAIL PROTECTED]> wrote: > select cal.date, coalesce(foo.x, 0) AS x > from (select (date_trunc('day', current_timestamp) + (s.s * interval '1 > day'))::date AS date > from generate_series(1,365) AS s) AS cal > left join foo ON cal.date = foo.create_date; Why

Re: [GENERAL] show all record between two date after group by and aggrigation...

2007-01-23 Thread Jorge Godoy
"Chad Wagner" <[EMAIL PROTECTED]> writes: > Most people do this with a "calendar" table, worst case is you could use > generate_series to do it (but it's ugly, and it may not scale well -- > haven't tested it) and left join it to your data table. > > select cal.date, coalesce(foo.x, 0) AS x > fro

Re: [GENERAL] show all record between two date after group by and aggrigation...

2007-01-22 Thread Chad Wagner
On 1/22/07, deepak pal <[EMAIL PROTECTED]> wrote: i am fatching record's from data base between two date range for registration_date coloum and than group by an count it using count(registration_date) i have to show all dates even if date is not there in registration_date ,it should show date an