Home  >  Article  >  Database  >  Oracle函数(字符串中搜索字符位置(全角算1字符))

Oracle函数(字符串中搜索字符位置(全角算1字符))

WBOY
WBOYOriginal
2016-06-07 16:58:261619browse

Oracle函数(字符串中搜索字符位置(全角算1字符))INSTR(C1,C2[,I[,J]])【功能】在一个字符串中搜索指定的字符,返回发现指定的字符

Oracle函数(字符串中搜索字符位置(全角算1字符))

INSTR(C1,C2[,I[,J]])

【功能】在一个字符串中搜索指定的字符,返回发现指定的字符的位置;

【说明】多字节符(汉字、全角符等),按1个字符计算

【参数】C1 被搜索的字符串C2 希望搜索的字符串I 搜索的开始位置,默认为1J 第J次出现的位置,默认为1

【返回】数值

【示例】select instr('oracle traning','ra',1,2) instring from dual;返回:9

【示例】select instr('重庆某软件公司','某',1,1),instrb('重庆某软件公司','某',1,1) instring from dual;

返回:3,5

linux

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