MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Bryan Koschmann - GKT Date:October 11 2002 5:11pm
Subject:padding field with zeros
View as plain text  

Does MySQL provide for any way to "pad" a field? I have accounts numbers
that vary from 3-5 digits, and would like them 8 digits padded by zeros
(479 becomes 00000479, 17234 becomes 00017234, etc). I know I could
probably write a script to fix that before entering the data into the
database, but I just wanted to know. Or maybe there is a way to pad it
while doing the query select?



padding field with zerosBryan Koschmann - GKT11 Oct
  • Re: padding field with zerosSteve Edberg12 Oct
  • Re: padding field with zerosPaul DuBois12 Oct