Subject | Re: how to get the same length result |
---|---|
Author | Ali Gökçen |
Post date | 2005-10-04T14:55:12Z |
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
Regards.
Ali
--- In firebird-support@yahoogroups.com, Yang Jin <ojinyang@y...>
wrote:
get ' 1', ' 12' and '123'.I use cast(XX as varchar(3)), but result
is dispoint.
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
Regards.
Ali
--- In firebird-support@yahoogroups.com, Yang Jin <ojinyang@y...>
wrote:
> hello,procedure.The content of field is '1', '12 and '123';I want to
> I want to get the same length varchar filed in table from
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
>