Sql syntax to Trim alphanumeric data in mysql phpmyAdmin -
is there syntax query in mysql phpmyadmin trim alphanumeric(varchar) data? here's how want happen:
in table have 2 fields id(int) , promocode(varchar)(25), inside promocode column have sample data befkr679gkqtx46afkp14vy
composed of (25) ...and want trim first 12 alphanumeric only, making these befkr679gkqt
.. , don't know how change existing 1,000 inputted data in table.. 12 not 25.
back tables. if can't this, don't continue.
test command on test table , make sure understand it:
update my_table set promocode = substring(promocode,1,12);
when works satisfaction on test tables, , complete, real table.
more info on mysql string functions here:
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
running sql phpmyadmin here:
Comments
Post a Comment