weixin_43456280 2019-09-17 01:24 采纳率: 0%
浏览 494

case when 里面使用regexp_replace 报错:ORA-00907: missing right parenthesis

不知道哪里出错了,请大神指点,多谢

select
case when instr(A.sPrintAddress,’校区’) > 0 then regexp_replace(A.sPrintAddress,'校区.+','校区')
     when instr(A.sPrintAddress,’中心’) > 0 then regexp_replace(A.sPrintAddress,'中心.+','中心')
ELSE sPrintAddress END sPrintAddress

from BS_Class A

where A.SDEPTCODE = '16'
and A.dtBeginDate >= to_date('2019/06/01 00:00:00','yyyy-mm-dd hh24:mi:ss')
and A.dtBeginDate < to_date('2019/06/06 00:00:00','yyyy-mm-dd hh24:mi:ss')

  • 写回答

1条回答 默认 最新

  • 毕小宝 博客专家认证 2019-09-17 09:07
    关注

    试试改成这样,case when 的结果给个别名 :

    ELSE A.sPrintAddress END as last_PrintAddress
    
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog