【发布时间】:2021-05-27 05:29:25
【问题描述】:
我有一组类似这样的数据:
我要做的是创建第三个字段,我们称之为length,它采用created_date 字段并为您提供基于created_date + months 的日期字段
所以实际上,第三列看起来像这样
但是当我尝试查找的方式时,它给了我一个错误:
SELECT
DATEADD('month', months, DATE(created_date))
FROM
table
ERROR: function date_add(unknown, double precision, date) does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
我只是使用了错误的语法类型,而我应该使用不同的函数吗?
【问题讨论】:
-
你在用什么rdbms?
-
错误消息闻起来像 PG。 stackoverflow.com/questions/27080505/…
标签: sql postgresql date-arithmetic