Suppose if we provide an empty string for padding on LPAD() or RPAD() function, then MySQL will return NULL as output. The following example will demonstrate it -
mysql> Select LPAD('ABCD',22,''); +--------------------+ | LPAD('ABCD',22,'') | +--------------------+ | NULL | +--------------------+ 1 row in set (0.00 sec) mysql> Select RPAD('ABCD',22,''); +--------------------+ | RPAD('ABCD',22,'') | +--------------------+ | NULL | +--------------------+ 1 row in set (0.00 sec)
The above is the detailed content of What will MySQL return if we provide an empty string to fill in other strings in the LPAD() or RPAD() function?. For more information, please follow other related articles on the PHP Chinese website!