From: Patrick Jacquot <patrick.jacquot@anpe.fr>
To: Antti Linno <alligator@all.ee>
Cc: pgsql-sql@postgresql.org
Subject: Re: GROUP by finish&&last day of month
Date: Wed, 05 Jul 2000 17:00:51 +0200
Message-ID: <39634DA2.B1665F0C@anpe.fr> (raw)
References: <Pine.LNX.4.04.10007051528140.13491-100000@all.ee>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: patrick.jacquot@anpe.fr, alligator@all.ee
Subject: Re: GROUP by finish&&last day of month
In-Reply-To: <39634DA2.B1665F0C@anpe.fr>
References: <Pine.LNX.4.04.10007051528140.13491-100000@all.ee> <39634DA2.B1665F0C@anpe.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox