首先ORACLE没有函数Substring,只有Substr
另外CASE函数oracle也没有,要用decode()函数解决

解决方案 »

  1.   

    8i不支持case,substring写错了,是substr
    select e.DEPT_NAME as DEPT_NAME,decode(Substr(a.meas_data_time,7,1),'Y','年报','Q','季报','W','月报') meas_type, a.MEAS_SET_ID as SET_ID,b.SET_NAME as SET_NAME,a.WORK_FLOW_INST_ID as INST_ID,b.TIME_ID as TIME_ID from WORK_FLOW_INST a,MSR$SET_TYPE b,MNG$USER_ROLE c,FLOW_NODE_ACTOR d,PUB$DEPARTMENT e where a.DEPT_ID=e.DEPT_ID(+) c.ROLE_ID=d.ROLE_ID and d.FLOW_NODE_ID=a.WORK_FLOW_ID and a.MEAS_SET_ID=b.SET_ID and c.USER_ID='wcy' and FLOW_RESU='未处理';
      

  2.   

    decode(Substr(a.meas_data_time,7,1),'Y',substr(a.meas_data_time,1,4)+'年','Q',substr(a.meas_data_time,1,4)+'年'+substr(a.meas_data_time,5,2)+'季度','M',substr(a.meas_data_time,1,4)+'年'+substr(a.meas_data_time,5,2)+'月') as data_time
    decode不能这么用吗?