为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: DM8
【操作系统】:Windows
【CPU】:
【问题描述】*:with tmp as
with tmp as
( select instance.id as id,
rectime.complet_time as rec_complete_time,
rectime.target_time as rec_target_time,
rectime.start_time as rec_start_time,
instance.close_time as close_time
from simo_process_instance instance
left join simo_itsm_blue_taskhandle task
on instance.id = task.process_id
left join simo_itsm_sla_slagamerectime rectime
on instance.id = rectime.pro_instance_id
where instance.freezed = 0
)
select * from tmp where 1=1 and (case when (1> 2) then (1 > 2) else (1<2) end)
执行失败(语句1)
-2007: 第 15 行, 第 47 列[>]附近出现错误:
语法分析出错
不知道我的解决方案可以不,反正我就是这样实现的
*Repo文件里面@Query查询条件存在if(?1 !='',srm.sm_role_id =?1 ,1=1)这种判断语句,达蒙数据库不识别这种写法
解决方案:
(case when ?1='' then true when srm.sm_role_id =?1 then true else false end)
希望能帮助到你
你少了一个括号吧
where 1=1 and (case when 1> 2 then 0 else 1 end)