当前位置: 代码迷 >> Oracle管理 >> repalce替换有关问题
  详细解决方案

repalce替换有关问题

热度:58   发布时间:2016-04-24 05:33:43.0
repalce替换问题
sum(case when replace((vw.billdate>to_date('2011/09/19 ','yyyy/mm/dd'))||'','>','<' ) then qty2 else 0 end ) qty1,
提示错误是丢失右括号

------解决方案--------------------
看一下ORACLE手册的说明:
REPLACE returns char with every occurrence of search_string replaced with replacement_string. If replacement_string is omitted or null, then all occurrences of search_string are removed. If search_string is null, then char is returned.
REPLACE返回的是CHAR类型,不是布尔类型的数据,
when replace() then ...,是错误的.