X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DA6A4D1E8A9 for ; Wed, 21 Jan 2004 09:36:24 +0000 (GMT) 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 78523-08 for ; Wed, 21 Jan 2004 05:35:55 -0400 (AST) Received: from serwer.skawsoft.com.pl (skawina.eu.org [80.48.213.66]) by svr1.postgresql.org (Postfix) with ESMTP id E8B96D1E84A for ; Wed, 21 Jan 2004 05:35:52 -0400 (AST) Received: from klaster.net (backbone.zab.citynet.pl [212.244.6.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 4410B2B3CC; Wed, 21 Jan 2004 10:35:28 +0100 (CET) Message-ID: <400E4847.1000908@klaster.net> Date: Wed, 21 Jan 2004 10:37:11 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.6b) Gecko/20031208 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: azwa@nc.com.my Cc: pgsql-sql@postgresql.org Subject: Re: time series data References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/192 X-Sequence-Number: 16585 Dnia 2004-01-21 09:53, Użytkownik azwa@nc.com.my napisał: > time_key integer not null default nextval('time_seq'::text) > Example of data in time table: > Time_key yr_id month_id month_desc day_id > 1999 1 Jan 1 > 1999 1 Jan 2 > 2000 1 Jan 1 Use this integer sequence and interval datatype to get date result: your_date='1994-01-01'::date+'1 day'::integer * time_key Now you can do whatever you want with this date - look at Postgresql documentation "6.8. Date/Time Functions and Operators" -> "extract" Regards, Tomasz Myrta