Similar to indexof usage in oracle _instr function

Similar to indexof usage in oracle _instr function the [sql] There is no indexof() function in oracle But it provides an instr() method specific usage: select instr('South District of Baoding City','City',1,1)-1 from dual; Explanation: 1. ‘South District of Baoding City’ => can be an expression or specific data     2. ‘市’ => is a sign of separation, here is the word “city” in the two sets of data  3. The first 1 starts from the left, if it is -1, it starts from the right. the 4. The second 1 is the number of times “city” appears. the www.2cto.com Under the GBK encoding, a Chinese occupies two bytes select instr('Baoding South District','city',1,1) from dual; the value is 5 select instr(‘Baoding Nanshi District’, ‘City’,1,2) from dual; the value is 9 the 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 the the Author qyongkang

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索