Stefano Bonnin wrote:
> Hi all,
>
> I have a "simple" question about the following temporal query with
> "interval" operator:
>
> can I define a query of this type?
>
> select myfield,numeric_field from mytable where temporal_attribute <
> temporal_attribute - interval numeric_field || ' days'
>
> obviously this syntax is wrong.
Not by much:
SELECT now() - (1 || ' days')::interval;
You could use CAST(...) instead of course, and a date plus/minus an
integer defaults to days.
--
Richard Huxton
Archonet Ltd