Subject Re: how to get the same length result
Author Ali Gökçen
Hi Jin,

select (case when substring(my3chars from 2 for 1)=''
then ' '||my3chars
when substring(my3chars from 3 for 1)=''
then ' '||my3chars
else my3chars end) as myrightjustified3chars
from mytable



--- In, Yang Jin <ojinyang@y...>
> hello,
> I want to get the same length varchar filed in table from
procedure.The content of field is '1', '12 and '123';I want to
get ' 1', ' 12' and '123'.I use cast(XX as varchar(3)), but result
is dispoint.
> Who can tell me a useful method, TIA!
> jinyang
> regard