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

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 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试