Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace leading spaces with leading zeros

Status
Not open for further replies.

christophorus

Technical User
Apr 3, 2006
9
US
I am trying to replace the leading blank spaces in a character column with leading zeros.

Ex: " 669025" to "00669025
 
Thanks!

I used replace with update:

mysql> update table_name set table_field = replace (table_field, ' ', '0');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top