0

I have millions of data in MySQL table, now I need to update one particular column of the table with only non-numeric characters. That is I need to remove all numbers from that column. The row wont be deleted, only updated with only non-numeric values.

I need some efficient way to achieve this.

Calling 10 times replace doesn't look good.

Thanks, Ashish

3
  • It would help if you posted the create table for the incriminated table. Commented Jul 8, 2013 at 8:43
  • Need more information - are the numbers same, do the columns have a mix of numeric and non numeric values? Some sample of the data would help. Commented Jul 8, 2013 at 8:44
  • 1
    Possible dublicate: stackoverflow.com/questions/11431831/… Commented Jul 8, 2013 at 8:47

1 Answer 1

-1

For mysql, you just have to replace everything:

Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(column,'9',''),'8',''),'7',''),'6',''),'5',''),'4',''),'3',''),'2',''),'1',''),'0',''); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.