--提取列值中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
本文介绍了如何使用SQL语句从指定字段中截取特定部分的方法,包括从固定字符后的值提取及更新操作。
1585

被折叠的 条评论
为什么被折叠?



