sql错误:ora-00905:缺少关键字0090500000使用case时“缺少关键字”

tcomlyy6  于 2021-07-26  发布在  Java
关注(0)|答案(0)|浏览(254)

我有一个sql查询

select * 
from ext_policysummary
where policydetail_id <> 'nan'
and case when '10-04-21' = '12-04-21'
then  partition_data = to_date('10-04-21','DD-MM-YYYY')
and RIGHT('0' + CAST(partition_hour AS VARCHAR(10)), 2) between cast('10-04-21' as varchar(10)) and cast('12-04-21' as varchar(10))
else partition_data = to_date('10-04-21','DD-MM-YYYY') and RIGHT('0' + CAST(partition_hour AS VARCHAR(10)),2) >= cast(partition_hour as varchar(20))
or (partition_data = to_date('12-04-21','DD-MM-YYYY') and RIGHT('0' + CAST(partition_hour AS VARCHAR(10)),2) <= cast(partition_hour as varchar(10)))
or  (partition_data > to_date('10-04-21','DD-MM-YYYY') and partition_date < to_date('12-04-21','DD-MM-YYYY')) end

我收到一个错误sql错误:ora-00905:缺少关键字00905。00000-“缺少关键字”
谁能告诉我哪里出错了吗。
谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题