oracle substr instr 用法

select temp.short_pjt 原来的名称,
       temp.fproject_name 变更后名称,
       temp.fflow_person_name 提交人,
       temp.fcreate_date 提交日期
  from (SELECT head.fsubject,
               t.fflow_person_name,
               t.fcreate_date,
               substr(head.fsubject,
                      instr(head.fsubject, '~', 1) + 1,
                      length(head.fsubject)) short_pjt,
               head.fproject_name
          FROM cop_cop_task t, cop.COP_FLOW_HEADER head
         where 1 = 1
           and t.fmodule_sys_sq = head.fmodule_sys_sq  
           and t.fflow_type_code = 'PROJECT_RENAME') temp
 group by temp.short_pjt,
          temp.fflow_person_name,
          temp.fcreate_date,
          temp.fproject_name
          order by temp.fcreate_date desc

posted @ 2016-11-08 12:38  albert_think  阅读(185)  评论(0编辑  收藏  举报