oracle笔记(2)----substr使用
oracle的substr函数的用法 取得字符串中指定起始位置和长度的字符串 substr( string, start_position, [ length ] )
如:
substr("This is a test", 6, 2) would return "is"
substr("This is a test", 6) would return "is a test"
substr("TechOnTheNet", -3, 3) would return "Net"
substr("TechOnTheNet", -6, 3) would return "The"
select substr("Thisisatest", -4, 2) value from dual 结果是 te
select substr("emros",-3,1) value from dual 结果是 r
substr("abcde",-6) = null
substr("abcde",-5) = "abcde"
substr("abcde",-4) = "bcde"
substr("abcde",-3) = "cde"
substr("abcde",-2) = "de"
substr("abcde",-1) = "e"
substr("abcde",-0) = "abcde"
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: php 怎么判断为顺子,三个相邻的数字
- 下一篇: js中对象的拷贝(复制)