X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4034CD1B43A for ; Wed, 28 Apr 2004 03:43:59 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 04832-06 for ; Wed, 28 Apr 2004 03:43:59 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 21992D1B454 for ; Wed, 28 Apr 2004 03:43:57 -0300 (ADT) Received: (qmail 7257 invoked by uid 500); 28 Apr 2004 06:48:13 -0000 Date: Wed, 28 Apr 2004 01:48:13 -0500 From: Bruno Wolff III To: Ray Jackson Cc: pgsql-sql@postgresql.org Subject: Re: date arithmetic over calender year boundaries Message-ID: <20040428064813.GB6901@wolff.to> Mail-Followup-To: Ray Jackson , pgsql-sql@postgresql.org References: <1083125554.408f2f328abed@webmail.geography.otago.ac.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1083125554.408f2f328abed@webmail.geography.otago.ac.nz> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/310 X-Sequence-Number: 17685 On Wed, Apr 28, 2004 at 16:12:34 +1200, Ray Jackson wrote: > Hi, > > The following Postgres 7.1 query extracts aggregated data for an > arbitrary period within each year for sites in a table containing > 30 years of temperature data. It isn't completely clear what you want to do, but you might be able to use date_part in a where clause to limit the data used for each year if the range within each year is the same.