> If this is so, IMNSHO it was a wrong decision:
> Zip codes are character strings, even though they may (in some / many
> countries) consist of digits only.
> Use a "char (n)" column for them, with "n" varying by country.
So did I, as in the char(n) however, the import script I wrote, in the
lang
Hi Scott, all!
Scott Haneda wrote:
I need to update a column, if the string length is less than 5, I want to
add leading zeros to it until it has 5. These are zip codes, I think there
are no 00 leading zips, so most should all be four chars long.
This sounds like the columns were of a numeri
> J.R. Bullington wrote:
>> The best way to do this is with code, however, here is A way to do it (I am
>> sure that there are more than one...)
>>
>> UPDATE tbl_Name SET ZipCodes = concat('0',ZipCodes) WHERE length(ZipCodes) =
>> 4
>>
> How about
>
> UPDATE tbl_Name SET ZipCodes = right(conca
J.R. Bullington wrote:
The best way to do this is with code, however, here is A way to do it (I am
sure that there are more than one...)
UPDATE tbl_Name SET ZipCodes = concat('0',ZipCodes) WHERE length(ZipCodes) =
4
How about
UPDATE tbl_Name SET ZipCodes = right(concat('0',ZipCodes), 5)
The best way to do this is with code, however, here is A way to do it (I am
sure that there are more than one...)
UPDATE tbl_Name SET ZipCodes = concat('0',ZipCodes) WHERE length(ZipCodes) =
4
Of course, this will involve you changing the length() if the ZipCode has
only 3 digits.
Also, of cours