LPAD
All functions > STRING > LPAD
Left pads a string to a specified length with a padding string.
Syntax
LPAD(expr, length, pad)
sql
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
string | VARCHAR | Yes | String to pad |
length | BIGINT | Yes | Target length for the result |
padding | VARCHAR | Yes | String to use for padding |
Returns
String padded on the left to the specified length
Notes
- If string is already longer than length, it is truncated from the right
- Padding string is repeated as needed
- If padding string is longer than needed, only part of it is used