Example
SELECT FIELD("q", "s", "q", "l");Definition and Usage
The FIELD() function returns the index position of a value in a list of values.
This function performs a case-insensitive search.
Note
If the specified value is not found in the list of values, this function will return 0. If value is NULL, this function will return 0.
Syntax
FIELD(
value
,
val1
,
val2
,
val3
, ...)Parameter Values
| Parameter | Description |
|---|---|
| value | Required. The value to search for in the list |
| val1 , val2 , val3 , .... | Required. The list of values to search |
Technical Details
| Works in: | From MySQL 4.0 |
|---|