MySQLString FunctionsLPAD
INSTR

LPADString Functions

RPAD

Left-pads a string to a specified length with a given character.

Syntax

LPAD(str, len, padstr)

Example

Enter values below to update the example in real time.

employee_id
emp_code
employees
-- 사번을 8자리 0 패딩
SELECT LPAD(employee_id, 8, '0') AS emp_code
FROM employees;