I have a table called "customers" in a database... i have a field in this table, called "zip_code"
zip_code varchar(255) utf8mb4_unicode_ci
zip code should be always 5 character... like "08001" or "28001" or "42001"
But i have certain cases were the field have been filled with only 4 character.. as "1001", "8901" or "1234"
I dont now how to write the sql sentence for this:
For all the data points in the field "zip_code" of the table "customers" with only 4 characters... add a "0" in the first place...
if the data is 8001... it should be 08001...
if the data is 1234 it should be 01234
taking care that there might be 28001 and 41234 that sould not be changed because they already have 5 characaters...
so i need the text to Run SQL query on table [login to view URL]:
27 freelanceria on tarjonnut keskimäärin €19 tähän työhön
Hello, I am an expert in database management and administration. I specialize in MYSQL, ORACLE and Postgress. I can work on your work ASAP. Come over the chat we discuss more. Thank you
Hola Soy un DBA de Valencia con más de 20 años de experiencia en Oracle, sql server, mysql , .... consultas sql. Te puedo ayudar con tu consulta. Saludos.
Hi there! I can help you with your script. Which database are you using? MySql? If you assign me the task I can start working right now. Thanks, George