Syntax
LPAD(str,len,padstr)
Purpose
You can call this function to left-pad the str string with the padstr string to the length specified by len.
If the length of str exceeds len, then the leftmost len characters in str are returned. If the length of str is less than len, and the total length of str and padstr is greater than len, then the rightmost len characters in the resulting string are returned.
Examples
obclient> SELECT LPAD('Base',9,'Ocean');
+------------------------+
LPAD('Base',9,'Ocean')
+------------------------+
OceanBase
+------------------------+
1 row in set (0.00 sec)
obclient> SELECT LPAD('Base',1,'Ocean');
+------------------------+
LPAD('Base',1,'Ocean')
+------------------------+
B
+------------------------+
1 row in set (0.00 sec)