Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query
optimization, and usability that you won’t want to miss.
Returns the first index of the str argument in the str1, str2, … list, or 0 if it doesn’t exist.
FIELD (str, str1, str2, ...)
str
: any string or binary objectstr1
, str2
, … : list of strings or binary objectsInteger
SELECT FIELD('abra', 'cadabra', 'abra', 'abracadabra');
+-------------------------------------------------+
| FIELD('abra', 'cadabra', 'abra', 'abracadabra') |
+-------------------------------------------------+
| 2 |
+-------------------------------------------------+