Reputation: 4283
I'm trying to replace all instances of  
with a simple space EXCEPT if it's surrounded by DIV tags. I've tried tinkering with the NOT REGEXP and NOT RLIKE within the replace query, like this:
UPDATE table SET column = replace(column,NOT REGEXP '> <',' ');
But it gives a syntax error. Anyone have any suggestions?
Upvotes: 0
Views: 1562
Reputation: 18369
How about three separate updates...
UPDATE table SET column = replace(column, '> <', '%%LOL$$');
UPDATE table SET column = replace(column, ' ', ' ');
UPDATE table SET column = replace(column, '%%LOL$$', '> <');
Upvotes: 1
Reputation: 3097
Something like this should work:
UPDATE table SET column = REPLACE(column, ' ', ' ') WHERE column NOT LIKE '%div> </%'
Upvotes: 0