LPAD
Left-pad a string. This function pads a string on the left side with a specified string until it reaches a certain length.
Syntax
LPAD(str, len [,padstr])Description
Examples
SELECT LPAD('hello',10,'.');
+----------------------+
| LPAD('hello',10,'.') |
+----------------------+
| .....hello |
+----------------------+
SELECT LPAD('hello',2,'.');
+---------------------+
| LPAD('hello',2,'.') |
+---------------------+
| he |
+---------------------+See Also
Last updated
Was this helpful?

