Home > Database > Mysql Tutorial > Oracle的substr函数的用法

Oracle的substr函数的用法

WBOY
Release: 2016-06-07 17:11:58
Original
1085 people have browsed it

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'

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template