sql
UPDATE my_table
SET my_column = REPLACE(my_column, 'aa', 'bb');
例
假设my_table表在替换前的数据如下:
| id | my_column |
|---|---|
| 1 | hello aa |
| 2 | world aa aa |
| 3 | no aa here |
执行上述UPDATE语句后,my_table表的数据将变为:
| id | my_column |
|---|---|
| 1 | hello bb |
| 2 | world bb bb |
| 3 | no bb here |