From: | Chris <dmagick(at)gmail(dot)com> |
---|---|
To: | sconeek(at)gmail(dot)com |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: catch SELECT statement return |
Date: | 2006-03-15 23:31:54 |
Message-ID: | 4418A3EA.9000906@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
sconeek(at)gmail(dot)com wrote:
> hi all,
> i am working on this postgresql statement. it picks up all non-null
> values only. is there a way to pickup all hour values (if any hour
> value not existing, still find them and assign their value to be 0).
> coz my table does not contain all hour values, only ones which have a
> non-zero value.
>
> SELECT to_timestamp(to_char (last_edit_timestamp,'YYYY-MM-DD
> HH24:00:00'), 'YYYY-MM-DD HH24:00:00')AS edit_time, count(to_char
> (last_edit_timestamp,'YYYY-MM-DD HH24:00:00'))
> as edit_time_count FROM dbpt_containerlog GROUP BY to_char
> (last_edit_timestamp,'YYYY-MM-DD HH24:00:00') ORDER BY to_char
> (last_edit_timestamp,'YYYY-MM-DD HH24:00:00');
I don't think it's possible. It won't come up with a left outer join
because you aren't comparing to anything unless you have a second table
with all of the times you want to compare.
--
Postgresql & php tutorials
http://www.designmagick.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Jaime Casanova | 2006-03-15 23:33:37 | Re: [GENERAL] Concurrencia |
Previous Message | Chris | 2006-03-15 23:28:14 | Re: Case Sensitive problem |