日期:2014-05-16  浏览次数:20765 次

mysql 函数相关

截取字符串"123_56"   '_'  以后的字符 :

select SUBSTRING("123_56",LOCATE('_',"123_56")+1) from DUAL

LOCATE 判断指定字符出现的位置.
select LOCATE('_',"123_56") from DUAL  返回 4,下标从1开始.

SUBSTRING 字符串截取
select SUBSTRING("123_56",4) from dual 返回 _56