在火鸟中我可以使用DateAdd
where 子句中的函数?
我有以下sql;
select
s.number,
s.warranty_start
from
serial_number s
where
s.warranty_start > dateadd(year, -3, 'now')
我收到错误;
expression evaluation not supported
您的第三个参数无效。
select
s.number,
s.warranty_start
from
serial_number s
where
s.warranty_start > dateadd(year, -3, current_timestamp)
'now'
是一个字符串文字,只能与date
关键字,例如date 'now'
。所以而不是current_timestamp
你需要写date
'now'`.
我更喜欢使用标准 SQL 函数,例如current_timestamp
如果两者等效,则超过 DBMS 特定的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)