我正在处理denodo视图(查询oracle数据库(,而max函数和partitionby不起作用。我正在寻找此查询的解决方法。这个查询几天前运行得很好,但最近我发现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
max函数与任何其他分析函数一样,可以向下推送到要执行的数据源,但服务器无法执行。
我建议你复习一下";委托分析函数列表";并确保它包含max函数。