On Fri, 17 Aug 2001 15:13:22 +0200
"Liana Wiehahn" <[EMAIL PROTECTED]> wrote:

> 
> Hi
> 
> I've got the following:
> 
> Table: Erf
> Column Name : PortionNumber
> DataType:  varchar(5)
> Records: 39000
> 
> The values of these records are all numbers that starts at 0 and ends at
> 200.
> 
> I would like to insert one or more '0', infront of all the numbers to make
> sure that the length of each record are 5 numbers.

I would keep that simple and just do it manually:

UPDATE Erf SET PortionNumber=Concat('0',PortionNumber) where length(PortionNumber)<5;

repeat this 4 times (or: until 0 rows affected).

Assumed is that the string is not padded with leading or trailing spaces...

regards,

rene


> 
> I know how to update a single record, but obviously 39000 wouldn't allow me
> to have a weekend :)
> 
> Liana
> [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to