Mysql 字符串函数

field(str,str1,str2,str3,....)是MySQL的一个字符串函数。此方法返回字符串的索引。

语法

select field(str,str1,str2,str3,...) 

示例 1

Selct field('a','b','c','d','a'); 

输出:


MySQL String FIELD() 函数

示例 2

Selct field(4,1,2,3,5,4,6); 

输出:


MySQL String FIELD() 函数

示例 3

Selct field(12,1,2,3,4,6); 

输出:


MySQL String FIELD() 函数