Thursday, November 12, 2015

TERADATA: LPAD Equivalent

LPAD


Teradata Equivalent for LPAD Function

SELECT '1'                                                                    AS CHAR_NUM
      ,SUBSTRING('000000' FROM 1 FOR 6-CHARS(TRIM(CHAR_NUM)))||TRIM(CHAR_NUM) AS LPAD_NUM
;


CHAR_NUM
LPAD_NUM
1
000001

No comments: