Skip site navigation (1) Skip section navigation (2)

Re: time series data

From: azwa(at)nc(dot)com(dot)my
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: time series data
Date: 2004-01-27 01:42:27
Message-ID: OF9F6AE314.E3F8364A-ONFFFFFF56.0024DC53@nc.com.my (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-sql
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


Dnia 2004-01-21 10:37, Użytkownik Tomasz Myrta napisał:

> Use this integer sequence and interval datatype to get date result:
> your_date='1994-01-01'::date+'1 day'::integer * time_key
 ^^^^^^^
Sorry, use interval here.

Regards,
Tomasz Myrta




azwa(at)postgresql(dot)org
Sent by: pgsql-sql-owner(at)postgresql(dot)org
01/21/2004 04:53 PM

        To:     pgsql-sql(at)postgresql(dot)org
        cc: 
        Subject:        [SQL] time series data



Hi, 


    i want to create time table  & the structure as below : 

                
Column 
 Type 
 Modifiers 
time_key 
yr_id 
month_id 
month_desc 
day_id 
 integer 
 integer 
 integer 
 text 
 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



time_key data will keep increment reading from sequence. i'm going to have 
a data from yr_id =1994 --> 2009 , month_id =1 -->12 
and day_id =1 -->31 for each month. So is there any solution (using 
function, or else) that can give me the  above data 
 in Postgresql??. 

 thanks in advance.

Responses

pgsql-bugs by date

Next:From: Tomasz MyrtaDate: 2004-01-27 09:56:49
Subject: Re: time series data
Previous:From: Tom LaneDate: 2004-01-27 00:59:15
Subject: Re: signal 11

pgsql-sql by date

Next:From: Bruno Wolff IIIDate: 2004-01-27 02:24:16
Subject: Re: Label Security
Previous:From: Tom LaneDate: 2004-01-27 01:08:27
Subject: Re: how to "enumerate" rows ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group