I have some messy data in a MySQL table that needs clearing. Everything should be either 3 or 4 characters, and those that are two characters need to have a leading zero.
Example Messy Data:
23
5351
142
91
4911
1514
53
931
984
Which should be:
023
5351
142
091
4911
1514
053
931
984
I've read that I should use either ZEROFILL or LPAD, but as mine vary in length (3-4) I'm not sure if this is the best method, I worry that 4 character data will be cut short or similar. I would appreciate some direction - thank you.
EDIT: I should add, the Type for this column is mediumint(2). I am free to change this if required.