Re: How to GROUP results BY month

Поиск
Список
Период
Сортировка
Искать
От
Oliveiros Cristina
Тема
Re: How to GROUP results BY month
Дата
Msg-id
008b01c8e8df$d7fa3830$ec5a3d0a@marktestcr.marktest.pt
Список
Дерево обсуждения
Rollback in Postgres "samantha mahindrakar" <sam.mahindrakar@gmail.com>
Re: Rollback in Postgres Mark Roberts <mailing_lists@pandapocket.com>
Re: Rollback in Postgres "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Rollback in Postgres Simon Riggs <simon@2ndquadrant.com>
Re: Rollback in Postgres Lewis Cunningham <lewisc@rocketmail.com>
Re: Rollback in Postgres Simon Riggs <simon@2ndquadrant.com>
Re: Rollback in Postgres Lewis Cunningham <lewisc@rocketmail.com>
Re: Rollback in Postgres "Dave Page" <dpage@pgadmin.org>
Re: Rollback in Postgres Simon Riggs <simon@2ndquadrant.com>
Re: Rollback in Postgres "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Rollback in Postgres Lewis Cunningham <lewisc@rocketmail.com>
Re: Rollback in Postgres "samantha mahindrakar" <sam.mahindrakar@gmail.com>
Re: Rollback in Postgres "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Rollback in Postgres Kaare Rasmussen <kaare@jasonic.dk>
Re: Rollback in Postgres Simon Riggs <simon@2ndquadrant.com>
Re: Rollback in Postgres Alvaro Herrera <alvherre@commandprompt.com>
Re: Rollback in Postgres Kaare Rasmussen <kaare@jasonic.dk>
Re: Rollback in Postgres Tom Lane <tgl@sss.pgh.pa.us>
Re: Rollback in Postgres Kaare Rasmussen <kaare@jasonic.dk>
Re: Rollback in Postgres "Jonah H. Harris" <jonah.harris@gmail.com>
Re: Rollback in Postgres Simon Riggs <simon@2ndquadrant.com>
Re: Rollback in Postgres "Jonah H. Harris" <jonah.harris@gmail.com>
Re: Rollback in Postgres Lewis Cunningham <lewisc@rocketmail.com>
Re: Rollback in Postgres Alvaro Herrera <alvherre@commandprompt.com>
Re: Rollback in Postgres "Richard Broersma" <richard.broersma@gmail.com>
Re: Rollback in Postgres Kaare Rasmussen <kaare@jasonic.dk>
Re: Rollback in Postgres Simon Riggs <simon@2ndquadrant.com>
Re: Rollback in Postgres "Richard Broersma" <richard.broersma@gmail.com>
Still another way to do :-)

Thanks, Lennin.

Best,
Oliveiros

----- Original Message ----- 
From: "Lennin Caro" 
To: ; "A. Kretschmer" 

Sent: Friday, July 18, 2008 3:04 PM
Subject: Re: [SQL] How to GROUP results BY month


>
> i think this work
>
> select id,count from table group by to_char(date,'MM')
>
> --- On Wed, 7/16/08, A. Kretschmer  
> wrote:
>
>> From: A. Kretschmer 
>> Subject: Re: [SQL] How to GROUP results BY month
>> To: pgsql-sql@postgresql.org
>> Date: Wednesday, July 16, 2008, 5:39 AM
>> am  Tue, dem 15.07.2008, um 18:15:07 -0700 mailte Mark
>> Roberts folgendes:
>> >
>> > On Tue, 2008-07-15 at 14:31 +0200, A. Kretschmer
>> wrote:
>> > > am  Tue, dem 15.07.2008, um 13:12:39 +0100 mailte
>> Oliveiros Cristina folgendes:
>> > > > 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?
>> > >
>> > > ... group by extract(month from date)
>> > >
>> > >
>> > > Andreas
>> >
>> > It's worth noting that extract(month from
>> timestamp) returns a month_no, and thus will not be
>> suitable for grouping queries that span years.
>>
>> Right, but that wasn't the question...
>>
>>
>> Andreas
>> -- 
>> Andreas Kretschmer
>> Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr:
>> -> Header)
>> GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA
>> http://wwwkeys.de.pgp.net
>>
>> -- 
>> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-sql
>
>
>
>
>
> -- 
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
> 


В списке pgsql-sql по дате отправления
От: Lennin Caro
Дата:
От: Mark Roberts
Дата:
FAQ