在使用datediff函数进行日期处理的时候为什么出现列不存在的错误?
代码如下:select
DATEDIFF(year,CAST(CAST(jsonb_extract_path_text(jsonb,'loanDate') AS char(10)) AS Date), CAST(CAST(jsonb_extract_path_text(jsonb,'returnDate') AS char(10)) AS Date))
FROM loan;
column "year" does not exist