Jump to content

Need help with update statement!


iPixel

Recommended Posts

Ok i need to do this for both MySQL & Oracle, but once i see how the mysql version works i can figure out the oracle way (hopefully).

 

I have 2 columns which contain numbers such as 2707, 23, 000289  etc...

as you can see they range from 2 to 6 characters, and i need them all to be 6 characters.

 

How could i write an update sql statement that would change all the #'s to 002707,000023,000289 etc...

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/209581-need-help-with-update-statement/
Share on other sites

What's the data type definition for the column?

 

If it's a string type, you would pad the values with zero's. if it's a numeric type, you would redefine the column to have a specific size with zero fill. Or you could just handle the zero pad/fill when you retrieve the data in your query or when you display the data in your php code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.