Max*_*ges 6 postgresql datediff
SELECT
"reviewedAt",
"createdAt",
DATEDIFF('hour', "createdAt"::timestamp, "reviewedAt"::timestamp) AS hours_approved
FROM "yadda$prod"."Application"
Run Code Online (Sandbox Code Playgroud)
错误[42883]错误:函数datediff(未知,没有时区的时间戳,没有时区的时间戳)不存在提示:没有函数与给定的名称和参数类型匹配。您可能需要添加显式类型转换。位置:36
小智 5
尝试这个:
SELECT
"reviewedAt",
"createdAt",
DATE_PART('day', "reviewedAt"::timestamp - "createdAt"::timestamp) * 24 + DATE_PART('hour', "reviewedAt"::timestamp - "createdAt"::timestamp) AS hours_approved
FROM "yadda$prod"."Application"
Run Code Online (Sandbox Code Playgroud)