当前位置:   article > 正文

oracle函数取字符串位置,oracle的substr函数:取得字符串中指定起始位置跟长度的字符串...

orcl 指定开始位置

oracle的substr函数的用法

122352795.gif 取得字符串中指定起始位置和长度的字符串   substr( string, start_position,[length])

122352795.gif 如:

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'

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/230980
推荐阅读
相关标签
  

闽ICP备14008679号