Mysql 字符串函数

instr(str,substr) 是MySQL 的一个字符串函数。此方法返回字符串中第一次出现的子字符串 substr的位置。

语法

select instr(str,substr);  

示例 1

Select instr('Yxjc123','jc'); 

输出:

mysql> Select instr('Yxjc123','jc');
+-----------------------+
| instr('Yxjc123','jc') |
+-----------------------+
|                     3 |
+-----------------------+
1 row in set (0.00 sec)