Syntax
LPAD(str,len,padstr)
Purpose
Fills the string str with the string padstr on the left until the length reaches len.
If the length of str is greater than len, the leftmost len characters of str are returned. If the length of str is less than len, and the concatenation of padstr and str exceeds len, the rightmost len characters of the concatenation are returned.
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
