sum(case when replace((vw.billdate>to_date('2011/09/19 ','yyyy/mm/dd'))||'','>','<' ) then qty2 else 0 end ) qty1,
提示错误是丢失右括号

解决方案 »

  1.   

    看一下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 ...,是错误的.