Lpad

String Function

Description

Extends the given string to the specified length by prepending the selected characters fill (a space by default). If the string is already longer than length then it is truncated (on the right).

Click here to navigate to the PostgreSQL docs page for this syntax.

The function Lpad() is supported on Snowflake.

Grammar Syntax

LPAD(string text, length integer [, fill text ] ) 

Sample Source Patterns

PostgreSQL

SELECT LPAD('12345', 10, 'X');

Snowflake

SELECT LPAD('12345', 10, 'X');

Last updated