Re: [GENERAL] Approximate join on timestamps

2007-03-21 Thread Alban Hertroys
Phil Endecott wrote: Dear Experts, I have two tables containing chronological data, and I want to join them using the timestamps. The challenge is that the timestamps only match approximately. My first attempt was something like t1 join t2 on (abs(t1.t-t2.t)'1 min'::interval) Of

[GENERAL] Approximate join on timestamps

2007-03-20 Thread Phil Endecott
Dear Experts, I have two tables containing chronological data, and I want to join them using the timestamps. The challenge is that the timestamps only match approximately. My first attempt was something like t1 join t2 on (abs(t1.t-t2.t)'1 min'::interval) Of course there is no abs for

Fwd: [GENERAL] Approximate join on timestamps

2007-03-20 Thread Rhys Stewart
-- Forwarded message -- From: Rhys Stewart [EMAIL PROTECTED] Date: Mar 20, 2007 6:50 PM Subject: Re: [GENERAL] Approximate join on timestamps To: Phil Endecott [EMAIL PROTECTED] had a similar problem a while back. so i made and abs_time function: CREATE OR REPLACE FUNCTION

Re: [GENERAL] Approximate join on timestamps

2007-03-20 Thread Jorge Godoy
Phil Endecott [EMAIL PROTECTED] writes: I have two tables containing chronological data, and I want to join them using the timestamps. The challenge is that the timestamps only match approximately. My first attempt was something like t1 join t2 on (abs(t1.t-t2.t)'1 min'::interval) Of

Re: Fwd: [GENERAL] Approximate join on timestamps

2007-03-20 Thread Jorge Godoy
Rhys Stewart [EMAIL PROTECTED] writes: had a similar problem a while back. so i made and abs_time function: CREATE OR REPLACE FUNCTION abs_time(interval) RETURNS interval AS $BODY$ BEGIN if $1 '00:00:00'::interval then return ($1 * -1)::interval; else return $1;

Re: [GENERAL] Approximate join on timestamps

2007-03-20 Thread Brent Wood
Phil Endecott wrote: Dear Experts, I have two tables containing chronological data, and I want to join them using the timestamps. The challenge is that the timestamps only match approximately. Hi Phil, This is how we dealt with a similar situation. It may be suitable for you We

Re: [GENERAL] Approximate join on timestamps

2007-03-20 Thread Klint Gore
On Tue, 20 Mar 2007 23:30:46 +, Phil Endecott [EMAIL PROTECTED] wrote: I have two tables containing chronological data, and I want to join them using the timestamps. The challenge is that the timestamps only match approximately. My first attempt was something like t1 join t2 on