数据库的substr函数用途有哪些
发布时间:12/01 来源:未知 浏览:
关键词:
数据库的substr函数用途:1、【SUBSTR(str,pos,len)】从pos开端的位置,截取len个字符;2、【SUBSTR(str,pos)】 pos开端的位置,不断截取到最后。
数据库的substr函数用途:
1、SUBSTR(str,pos,len)
: 从pos开端的位置,截取len个字符
substr(string ,1,3) :取string左边第1位置起,3字长的字符串。
所以效果为: str
substr(string, -1,3):取string右侧第1位置起,3字长的字符串。显然右侧首先位置起往右不足3字长。
效果只能是: g
substr(string, -3,3):取string右侧第3位置起,3字长的字符串。
效果为: ing
2、SUBSTR(str,pos): pos
开端的位置,不断截取到最后
substr(string ,4) : 从右第4位置截取到最后
效果是: ing
更多相干免费学习举荐:mysql教程(视频)
以上就是数据库的substr函数用途有哪些的细致内容,更多请关注 百分百源码网 其它相干文章!