Re: time series data - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: time series data
Date
Msg-id 401635E1.8040204@klaster.net
Whole thread Raw
In response to Re: time series data  (azwa@nc.com.my)
List pgsql-sql
Dnia 2004-01-27 02:42, Użytkownik azwa@nc.com.my napisał:
> 
> 
> Hi,
> 
>    thanks for the info..btw can u pls explain a little bit detail since 
> i can't get thru yr solution.
> thanks in advance

insert into time_table (time_key,year_id,month_id,month_desc,day_id)
select  newid,  extract('year' from your_date),  extract('month' from your_date),  to_char(your_date,'mon'),
extract('day'from your_date)  ...
 
from (select nextval('time_seq') as newid,
'1994-01-01'::date+'1 day'::interval * currval('time_seq') as your_date) x;


Everything you need is to execute query above as many times as you need.

Regards,
Tomasz Myrta


pgsql-sql by date:

Previous
From: azwa@nc.com.my
Date:
Subject: Re: time series data
Next
From: "Cavit Keskin"
Date:
Subject: PgSQL Down