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.

  1. back tables. if can't this, don't continue.

  2. test command on test table , make sure understand it:

    update my_table set promocode = substring(promocode,1,12); 
  3. 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:

http://community.mybb.com/thread-4720.html


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -