I have column in my table pin_code whose size must be 6 chars ,but there are some values present in tbale with less that 6 chars.It have 2,3,4 or 5 chars values,i WANT TO MIGRATE THOSE VALUES ,Want to add zero to right side according to therir current content
if one row in column have pin _code as "1" now want to migrat it as "100000" want pass 5 zero to right side
I want migrate the data for all rows who may have 2char pin code,3,4 or 5
Plz suggest me some function ,or common way to migarte all values in table
select * from t_clnt_address
case when len(pin_code)=1 then pin_code+'00000'
when len(pin_code)=2 then pin_code+'0000'
when len(pin_code)=3 then pin_code+'000'
when len(pin_code)=4 then pin_code+'00'
when len(pin_code)=5 then pin_code+'0'
but its not working