mysql / oracle 的 instr( field, str ) 函数,其中 field 是输入的字符串,str 是要查找的字符串。
返回字符串 str 的位置,而不是索引,没找到就是 0
select instr('helloworld', 'lo') from dual; ---返回结果:4
select instr('helloworld', 'wo') from dual; ---返回结果:6
本文详细介绍了SQL中INSTR函数的使用方法,该函数用于查找一个字符串在另一个字符串中的位置。通过具体示例,展示了如何使用INSTR函数定位特定子串的位置,包括在未找到子串时返回0的情况。
mysql / oracle 的 instr( field, str ) 函数,其中 field 是输入的字符串,str 是要查找的字符串。
返回字符串 str 的位置,而不是索引,没找到就是 0
select instr('helloworld', 'lo') from dual; ---返回结果:4
select instr('helloworld', 'wo') from dual; ---返回结果:6
1835
1187
686

被折叠的 条评论
为什么被折叠?