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

Ashish
  • 402
  • 2
  • 6
  • 15
  • It would help if you posted the `create table` for the incriminated table. – bpgergo Jul 08 '13 at 08: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. – unlimit Jul 08 '13 at 08:44
  • 1
    Possible dublicate: http://stackoverflow.com/questions/11431831/remove-all-numeric-characters-from-column-mysql – Maxim Zhukov Jul 08 '13 at 08:47

1 Answers1

-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',''); 
Kzqai
  • 22,588
  • 25
  • 105
  • 137
SATSANGI
  • 29
  • 1
  • 2
  • 7