提取特定字符的值

来源:互联网 发布:网络培训好吗 编辑:程序博客网 时间:2024/05/16 09:30

--提取列值中2个固定字符的值

select substr(kcmc,instr(kcmc,'[')+1,instr(kcmc,']')-2) from cjb_gxgsyssj

--提取列值中某个固定字符后所有的值

select substr(kcmc,instr(kcmc,']')+1,length(kcmc)-instr(kcmc,']')) khfs from cjb_gxgsyssj

update cjb_gxgsyssj2 a set a.kcmc=substr(kcmc,instr(kcmc,']')+1,length(kcmc)-instr(kcmc,']'));

---提取选课课号固定字符后所有值



select xkkh, substr(xkkh,instr(xkkh,'-',-1)+1,length(xkkh)-instr(xkkh,'-',-1)) kcxh from xxkjxrwb

原创粉丝点击