我正在处理 denodo 视图(查询 oracle DB),并且 max 函数以及 partition by 不起作用。我正在寻找此查询的解决方法。这个查询几天前运行良好,但最近我得到 max 函数不是可执行错误。
select
case WHEN ((current_date-max((ccst.screened_dtm) OVER ( PARTITION BY ccst.name, ccst.id )) < 30))
THEN 'Screened in 30' ELSE 'Not Screened in Last 30' END AS l_30_srnd
or current_date-max(completed_dtm) over (partition by study_name ,id ) < 30
or current_date-max(screened_dtm) over (partition by study_name ,site_id ) < 30
then 'Active in Last 30 '
else 'No Activity in Last 30 ' end as r_f
FROM site_v1 AS ccis LEFT OUTER JOIN subjects_v1 AS ccst
ON ccis.name = ccst.name
AND ccis.code = ccst.code
AND ccis.id = ccst.id
数据:
screened_dtm name id
2017-01-20 011001 2001
2013-01-21 D52-PL10018 2202
2015-01-21 D52-PL1 3454
错误:
Finished with error: Error executing view: Function max is not executable