Using Replace in Mysql with Regex -


i discovered # of records in table field seems have carriage returns. found them using:

select field table field regexp "\r\n" 

i'd remove them using regex in replace did not work:

update table set field=replace(field,regexp "\r\n",'') field regexp "\r\n" 

as aside have found several fields did not match regex query still show in memo field broken e..g

queen  anne 

vs

queen ann 

is there other regex character should adding can search on any/all combinations , replace not getting space?

you want replace():

update table     set field = replace(field, '\r\n', '')     field regexp '\r\n'; 

mysql should recognize '\r' , '\n' in string (see here).


Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -