Output of CONCAT Function with NULL in String Linking



MySQL CONCAT() function will return a NULL if you will add a NULL value while linking two strings. Following example will demonstrate it −

Example

mysql> Select CONCAT('Tutorials',NULL,'Point');
+----------------------------------+
| CONCAT('Tutorials',NULL,'Point') |
+----------------------------------+
| NULL                             |
+----------------------------------+
1 row in set (0.06 sec)

mysql> Select CONCAT('TutorialsPoint','.com',NULL);
+--------------------------------------+
| CONCAT('TutorialsPoint','.com',NULL) |
+--------------------------------------+
| NULL                                 |
+--------------------------------------+
1 row in set (0.00 sec)
Updated on: 2020-06-22T07:22:58+05:30

90 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements