|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: "Repairing Data" packing with zeros
From: zzapper (david
tvis.co.uk)
Date: Fri Mar 25 2005 - 12:46:05 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 25 Mar 2005 12:03:26 -0500, wrote:
>zzapper wrote:
>
>> ONE1 -> ONE0001
>> ABC23 -> ABC0023
>> FGH123 -> FGH0123
>>
>> What Update Query should/could I have used?
>
>Something like this perhaps?
>
>UPDATE table_name SET propertyID = CONCAT(LEFT(propertyID, 3),
>LPAD(SUBSTRING(propertyID, 4), 4, '0'))
>WHERE propertyID REGEXP '^[A-Z]{3}[0-9]{1,3}$';
Keith,
Thanx that works just fine
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]