我试图运行此查询,但是我收到以下错误: ORA-00923:找不到FROM关键字。
select case when trunc( MGM.period_start_time, 'mi' ) < (trunc( MGM.period_start_time, 'hh' ) +numToDSInterval( 15, 'minute' ))
then trunc( MGM.period_start_time, 'hh' )
when trunc( MGM.period_start_time, 'mi' ) < (trunc( MGM.period_start_time, 'hh' ) +numToDSInterval( 30, 'minute' ))
then (trunc( MGM.period_start_time, 'hh' ) +numToDSInterval( 15, 'minute' ))
when trunc( MGM.period_start_time, 'mi' ) < (trunc( MGM.period_start_time, 'hh' ) +numToDSInterval( 45, 'minute' ))
then (trunc( MGM.period_start_time, 'hh' ) +numToDSInterval( 30, 'minute' ))
else (trunc( MGM.period_start_time, 'hh' ) +numToDSInterval( 45, 'minute' ))
end as trunc(MGM.period_start_time ,'mi') period_start_time,
SUM(test_date) OVER (ORDER BY TRUNC(MGM.period_start_time, 'mi') range between interval '0' minute PRECEDING and interval '60' minute following ) sum_total
from MGM
答案 0 :(得分:2)
您的错误在这里:
end as trunc(MGM.period_start_time ,'mi') period_start_time
这应该是
end as period_start_time