Roberto C
Roberto C

Reputation: 301

mysql - query to remove multiple characters from column content

Can I create a query using "replace" to remove more than one character\string from a column content ?

For example I have:

UPDATE table1 SET column1 = REPLACE(column1, '\r\n', '');

But what if I want to remove multiple characters or strings like:

<br />
<&nbsp>
<\r> 

Is it possible to run this in single query ?

Upvotes: 1

Views: 3428

Answers (1)

juergen d
juergen d

Reputation: 204756

cascade it

UPDATE table1 
SET column1 = replace(replace(REPLACE(column1, '\r\n', ''), '<br />',''), '<\r>','')

Upvotes: 2

Related Questions