Oliveiros Cristina wrote:
> Howdy, all,
> I have a problem.
> I have a table which one of the fields is of type date.
> I need to obtain the totals of the other fields in a by-month basis
> IS there any easy way to do this using the GROUP BY or any other
Yes, use date_trunc( 'month', time_stamp ).
select count(*),date_trunc( 'month', time_stamp ) from rb group by
date_trunc( 'month', time_stamp );
In response to
pgsql-sql by date
|Next:||From: Jonah H. Harris||Date: 2008-07-15 13:59:22|
|Subject: Re: Rollback in Postgres|
|Previous:||From: Herouth Maoz||Date: 2008-07-15 12:32:15|
|Subject: Re: How to GROUP results BY month|