oracle函数使用

select l.made_dept_id,replace(substr(l.made_dept_path,INSTR(l.made_dept_path,'/',1,1)+1,length(l.made_dept_path)),'/') mdeptName from lm_storage_standard l group by l.made_dept_id,l.made_dept_path

使用情况replace(x,y,z)返回值为将串X中的Y串用Z串替换后的结果字符串。若省略Z参数,则将串X中为Y串的地方删除
substr截取其中某个字符
INSTR计算具体某个字符的位置

猜你喜欢

转载自ilovegreenrose.iteye.com/blog/1914834