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
construct?
Yes, use date_trunc( 'month', time_stamp ).
Example:
select count(*),date_trunc( 'month', time_stamp ) from rb group by
date_trunc( 'month', time_stamp );
Herouth
--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql