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
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
-- 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
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
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;
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
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