Mengembalikan indeks (posisi) str dalam daftar str1, str2, str3, .... Mengembalikan 0 jika str tidak ditemukan.
SELECT FIELD('Bb', 'Aa', 'Bb', 'Cc', 'Dd', 'Ff');
2
SELECT FIELD('Gg', 'Aa', 'Bb', 'Cc', 'Dd', 'Ff');
0
If all arguments to FIELD() are strings, all arguments are compared as strings. If all arguments are numbers, they are compared as numbers. Otherwise, the arguments are compared as double.
SELECT FIELD('Bb', 'Aa', 'Bb', 'Cc', 'Dd', 'Ff');
2
SELECT FIELD('Gg', 'Aa', 'Bb', 'Cc', 'Dd', 'Ff');
0