发表于: DB/ES | 作者: | 日期: 2009/8/12 08:08

instr的语法如下:
instr( string1, string2 [, start_position [, nth_appearance ] ] )

函数说明:
该函数返回参数string2在参数string1中的位置。
start_position参数表示将从string1的第几个字符开始来查找string2。该参数为可选参数,如果省略,那么默认为1。instr函数默认的查找顺序为从左到右。当该参数为负数的时候,则从右边开始查找。

nth_appearance表示返回第几次出现的string2的位置。该参数为可选参数,如果省略则默认为1,也就是返回首次出现string2的位置。

示例:
SELECT INSTR(‘CORPORATE FLOOR’, ‘OR’, -1, 1) “aaa” FROM DUAL;

aaa
———-
14

参考链接:
http://www.techonthenet.com/oracle/functions/instr.php
http://download.oracle.com/docs/cd/B28359_01/olap.111/b28126/dml_functions_1103.htm
http://www.psoug.org/reference/substr_instr.html

: https://blog.darkmi.com/2009/08/12/932.html

本文相关评论 - 1条评论都没有呢
Post a comment now » 本文目前不可评论

No comments yet.

Sorry, the comment form is closed at this time.