Similar indexof usage _instr functions in Oracle
[SQL] does not have a indexof () function in Oracle but provides a InStr () method for specific usage: Select InStr (' Baoding Nanshi District ', ' City ', ' 1 ')-from dual; Explanation: 1. ' Baoding Nanshi District ' + can be an expression, or it can be a specific data 2. ' City ' is the sign of separation, here is the word "city" in two sets of data 3. The first 1 starts from the left and, if 1, starts from the right. 4. The second 1 is the first occurrence of the "city". Www.2cto.com in the GBK code, a Chinese account of two bytes Select InStr (' Baoding Nanshi District ', ' City ', ' Max ') from dual; The value is 5 select InStr (' Baoding Nanshi District ', ' City ', ' n ') from dual; The value is 9 Select InStr (' Baoding Nanshi District ', ' City ', -1,1) from dual; The value is 9 Select InStr (' Baoding Nanshi District ', ' City ', -1,2) from dual; the value is 5
Similar indexof usage _instr functions in Oracle