What MySQL returns if the search string is not in the list of strings provided as argument in FIELD() function?

MySQLMySQLi Database

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)
raja
Published on 20-Feb-2018 05:59:25
Advertisements