Re: GROUP by finish&&last day of month

From: Patrick Jacquot <patrick(dot)jacquot(at)anpe(dot)fr>
To: Antti Linno <alligator(at)all(dot)ee>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: GROUP by finish&&last day of month
Date: 2000-07-05 15:00:51
Message-ID: 39634DA2.B1665F0C@anpe.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Antti Linno wrote:

> Ok, if I want to get non-aggregat data in groups, I use order by. This
> group by seemed so logical though, but the fruit that u can't have, is
> usually the most sweet.
>
> New question, how to get the last day of month(order data by last day of
> month). And to prevent chain letter from misunderstanding, no I don't
> intend to look it up from calendar and then input it manually.
>
> A.

to get last day of month :
1) use date-trunc to truncate to first day of month
2) add one month
3) substract 1 day

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Martin, Sylvain R. (LNG) 2000-07-05 15:04:46 RE: bug in using index scans? More Investigating
Previous Message Martin, Sylvain R. (LNG) 2000-07-05 14:56:21 bug in using index scans?