我试着把它理解为:
SELECT * FROM "Employee" WHERE TIMESTAMPDIFF('YEAR', "BirthDate", "HireDate");
但是我得到了下一个错误:
ERROR: function timestampdiff(unknown, timestamp without time zone, timestamp without time zone) does not exist
LINE 1: SELECT * FROM "Employee" WHERE TIMESTAMPDIFF('YEAR', "BirthD...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
我已经找到了另一种方法来获得两个日期之间的差异,但在我的说明中,它说我必须通过TIMESTAMPDIFF
获得它。有人能帮我看看哪里以及如何修复我的错误吗?
发布于 2018-10-22 01:35:41
您可以使用减号运算符
EXTRACT(DAY FROM (HireDate)-(BirthDate)) AS DateDifference
示例select date '2001-10-01' - date '2001-09-28'
https://stackoverflow.com/questions/52918043
复制相似问题