Richard Huxton <[EMAIL PROTECTED]> writes:
> SELECT now() - (1 || ' days')::interval;
Note that the preferred form is
SELECT now() - (n * '1 day'::interval);
if n is a numeric variable. When you write
SELECT now() - (n || ' days')::interval;
you are relying on the following: (
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
The usual syntax is something like:
select myfield,numeric_field
from mytable
where temporal_attribute_a < temporal_attribute_b - ( numeric_field * '1
day'::interval);
One of the temporal_attributes tends to be 'now' or 'today' but the
principle is the same...
On Tue, Nov 30, 2004 at 11:30:16
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