Re: interval question

From: "Stefan Waidele jun(dot)" <St(dot)Waidele(dot)jun(at)Krone-Neuenburg(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: interval question
Date: 2001-03-06 07:33:54
Message-ID: 5.0.2.1.0.20010306083058.025d4640@imap.Krone-Neuenburg.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 21:59 05.03.2001 -0300, Fernando P. Schapachnik wrote:
>[...]
> I want to know which ids are current, ie, which satisfy
>start<=now<=start+duration.
>
> The problem is that start+duration is an interval, and I
>can't find the way to cast now to interval or interval to time or
>tinterval in order to make the comparison.
>
> Any ideas?

Yes, maybe...

'0:00'+start <= '0:00'+now <= start+duration

It is not really beautiful, and I have not tested it, but if it works: The
are no awards for beauty, are there?

Stefan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2001-03-06 07:44:51 max(field) vs select field .. order by desc limit 1
Previous Message Simon Crute 2001-03-06 07:26:31 How robust is postgresql ?