Re: time series data - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: time series data
Date
Msg-id 400E4847.1000908@klaster.net
Whole thread Raw
In response to time series data  (azwa@nc.com.my)
Responses Re: time series data
List pgsql-sql
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


pgsql-sql by date:

Previous
From: azwa@nc.com.my
Date:
Subject: time series data
Next
From: Tomasz Myrta
Date:
Subject: Re: time series data