Remove a character on a certain column

A

Anonymous

Guest
Hi guys

How can I remove a character on a certain column. For example, I have a table in mysql and it has a column "cert_no" (varchar). This column should only have numbers in it, but for some reason when I imported a csv file, some values on the column has "-" before the number ex. -44567. How can i remove all the "-" before the number using phpmyadmin?

Thank you very much.
 
Use the INT field type instead of VARCHAR.
Ex: cert_no INT(10)
Change this and make the import operation again.
 
hay man, thanks. but what if the records are already there. no other imports needed, is there a script in phpmyadmin that can do that?
 
Never did such thing, but... try this out.
I can't try it right now, but got a great feeling :)
Code:
UPDATE table SET field = SUBSTRING(field, - 1);
 
Back
Top