What MySQL Returns for NULL in FIELD Function



In case if all the arguments (list of strings) of FIELD() function are NULL then MySQL will return 0 as output.

Example

mysql> Select FIELD('Ram',NULL,NULL,NULL,NULL);

+----------------------------------+
| FIELD('Ram',NULL,NULL,NULL,NULL) |
+----------------------------------+
|                               0  |
+----------------------------------+

1 row in set (0.00 sec)
Updated on: 2020-06-20T08:43:16+05:30

89 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements