Re: time series data

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: azwa(at)nc(dot)com(dot)my
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: time series data
Date: 2004-01-21 09:37:11
Message-ID: 400E4847.1000908@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dnia 2004-01-21 09:53, Użytkownik azwa(at)nc(dot)com(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2004-01-21 11:36:18 Re: time series data
Previous Message azwa 2004-01-21 08:53:11 time series data