hello,
using 7.2.1
is there any reason why the order of operations of the following query
would matter?
here's an example:
diw=# select interval '40 years' + date '2001-01-01' as test;
test
---------------------
2001-01-01 00:00:00
(1 row)
diw=# select date '2001-01-01' + interval '40 years' as test;
test
---------------------
2041-01-01 00:00:00
(1 row)
note how the first query doesn't return the proper response.
also, is there a difference between:
"interval('40 years') " and "interval '40 years' " ?
or
"date('2001-01-01')" and "date '2001-01-01' " ?
because only the query at the top of this message works, the following
doesn't:
diw=# select date('2001-01-01') + interval('40 years') as test;
ERROR: parser: parse error at or near "'"
I realize that answers my question, but why?
any help would be appreciated!!!