Received: from mickey.anpe.fr (smtp1.anpe.fr [195.101.137.20]) by hub.org (8.10.1/8.10.1) with ESMTP id e65D5SS43713 for ; Wed, 5 Jul 2000 09:05:29 -0400 (EDT) Received: from antivirus.anpe.fr ([10.0.4.95]) by mickey.anpe.fr (Netscape Messaging Server 4.05) with SMTP id FX870E00.N6W; Wed, 5 Jul 2000 15:05:02 +0200 Message-ID: <39634DA2.B1665F0C@anpe.fr> Date: Wed, 05 Jul 2000 17:00:51 +0200 From: Patrick Jacquot Organization: cti Noisiel X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.9-19mdk i586) X-Accept-Language: en MIME-Version: 1.0 To: Antti Linno CC: pgsql-sql@postgresql.org Subject: Re: GROUP by finish&&last day of month References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200007/42 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