Home  >  Article  >  Database  >  Oracle的substr函数的用法

Oracle的substr函数的用法

WBOY
WBOYOriginal
2016-06-07 17:11:581057browse

Oracle的substr函数的用法 取得字符串中指定起始位置和长度的字符串

Oracle的substr函数的用法 取得字符串中指定起始位置和长度的字符串  

  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'

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn