This tutorial explains how to use the MySQL FIELD function with syntax and examples.
The MySQL FIELD function returns the position of a value in a list of values (val1, val2, val3, ...).
The syntax for the FIELD function in MySQL is:
The value to find in the list.
The list of values that is to be searched.
The FIELD function can be used in the following versions of MySQL:
Let's look at some MySQL FIELD function examples and explore how to use the FIELD function in MySQL.
For example: