0
Based on our stats gathered across the U.S.        95%      of Flight Department Managers were males while        95%      were females.

I've got this sentence on a few thousand wordpress posts where Flight Department Managers is the dynamic factor here obviously.

What I need to do is replace the first 95% to %5, but only on posts that have both 95% for male and female in this sentence.

So the above sentence would read as

Based on our stats gathered across the U.S.        5%      of Flight Department Managers were males while        95%      were females.
4

1 回答 1

0

您可以编写如下内容:

UPDATE table_name
   SET column_name = REPLACE(column_name, ' U.S.        95% ', ' U.S.        5% ')
 WHERE column_name REGEXP ' 95% .* 95% '
;
于 2013-03-22T01:25:29.910 回答