How to update multiple rows with different values in mysql?

Posted by user210481 on Stack Overflow See other posts from Stack Overflow or by user210481
Published on 2010-03-17T23:14:28Z Indexed on 2010/03/17 23:21 UTC
Read the original article Hit count: 320

Filed under:
|
|
|
|

I have a table with a column 'A'. Some rows have 14 digits for the column 'A' and some have only 12. I need to transform all the entries to 14 digits. The datatype is varchar

I would like to update all the rows at once (one query), adding zeros before the first digit, so an entry like 012345678910 would become 00012345678910.

Is it possible to do it in one single query? Thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql