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 from (select

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 not,

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

2007-01-22 Thread deepak pal
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 and 0 in count.,how can i do it plz healp...

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 and