LPAD Function in SQL

LPAD

This will allows you to pad the left side of a column with any set of characters.

Syntax: lpad (string, length [, padding_char])

Ex:

select lpad('computer',15,'*'), lpad('computer',15,'*#') from dual;                   

output

lpad('computer',15,'*')
------------------------
*******computer
lpad('computer',15,'*#')
-------------------------
*#*#*#*computer
LPAD function in SQL
LPAD function in SQL

Default padding character was blank space.

Leave a Reply