Declaration
LPAD(str,len,padstr)
Description
The padstr function pads the left side of the string str with the character string char until the length of str is len.
If the length of str is greater than len, the function returns the first len characters of str. If the length of str is less than len, and the concatenated string of padstr and str is longer than len, the function returns the last len characters of the concatenated string.
Examples
obclient> SELECT LPAD('Base',9,'Ocean');
+------------------------+
| LPAD('Base',9,'Ocean') |
+------------------------+
| OceanBase |
+------------------------+
1 row in set
obclient> SELECT LPAD('Base',1,'Ocean');
+------------------------+
| LPAD('Base',1,'Ocean') |
+------------------------+
| B |
+------------------------+
1 row in set