PostgreSQLString FunctionsLPAD
POSITION

LPADString Functions

RPAD

Left-pads a string to a specified length.

Syntax

LPAD(str, n, fill)

Example

Enter values below to update the example in real time.

employee_id
emp_code
employees
SELECT LPAD(employee_id::text, 8, '0') AS emp_code
FROM employees;