2017-04-07 16 views
-1

この問合せを実行しようとしていますが、次のエラーが表示されます。ORA-00923:FROMキーワードが予期しないところに見つかりません。ORA-00923:FROMキーワードが見つからない場合は、case文を使用してください。

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 

答えて

2

あなたのエラーはここにある:

end as trunc(MGM.period_start_time ,'mi') period_start_time 

これはおそらく動作します

end as period_start_time 
+0

でなければなりません...ありがとう – aaru

関連する問題