What MySQL returns if the search string is not in the list of strings provided as argument in FIELD() function?
Suppose if the search string is not in the list of strings provided as the arguments in FIELD() function then MySQL will return 0 as output.
Example
mysql> Select FIELD('Ram','New','Delhi');
+----------------------------+
| FIELD('Ram','New','Delhi') |
+----------------------------+
| 0 |
+----------------------------+
1 row in set (0.00 sec)
Related Articles
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?
- What MySQL returns if the search string, provided in FIELD() function, is NULL?
- What MySQL ELT() function returns if the index number, provided as an argument, is higher than the number of strings?
- When MySQL SUBSTRING_INDEX() function returns the same string, provided in the argument, as output?
- What MySQL returns if the argument of QUOTE() function is NULL?
- What MySQL returns if the first argument of INTERVAL() function is NULL?
- What would be the output of MySQL ELT() function if the index number, provided as an argument, is not an integer?
- What happens if a NULL argument is provided in MySQL CONV() function?
- What MySQL TRIM() function returns if 1st argument(i.e. BOTH, LEADING, TRAILING) is not specified?
- What would be the effect on MySQL output if we have the combination of NULL and other values in the list of strings, provided as arguments in FIELD() function?
- What MySQL returns on passing an invalid string as an argument to STR_TO_DATE() function?
- What MySQL returns if we use NULL, as both the arguments, as one of the argument and as a separator, in CONCAT_WS() function?
- What MySQL returns if specified format string is not as per accordance with the date string passed as arguments to STR_TO_DATE() function?
- What MySQL ASCII() function returns if no parameter is provided to it?
- What MySQL CHAR_LENGTH() function returns if no parameter is provided to it?
Kickstart Your Career
Get certified by completing the course
Get Started