Re: problems with date and interval queries.

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: <john(at)flowlabs(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: problems with date and interval queries.
Date: 2003-02-10 18:14:15
Message-ID: 20030210101150.P99596-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Mon, 10 Feb 2003 john(at)flowlabs(dot)com wrote:

> I am having problems adding an interval to a date in a select statement
> where the interval is specified as a selected column. Is this possible?
> Below is an example of the query that I'm executing. The query gives and
> error at the num_min column in the outer query. It works fine if that is
> replaced with the text '90 minutes'. Thank you in advance for all help
> provided.

interval <stuff> is the form for an interval literal. If the column is
already an interval, you probably don't need it at all. If you need to
cast it you should do a cast CAST (num_min AS INTERVAL)

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-02-10 18:21:25 Re: problems with date and interval queries.
Previous Message john 2003-02-10 18:05:18 problems with date and interval queries.