Reputation: 197
| 382 | Ongoing |
| 383 | Ongoing |
| 384 | Ongoing |
| 385 | Ongoing |
| 386 |
Ongoing
|
| 387 |
Ongoing
|
| 388 |
Ongoing
|
| 389 |
Ongoing
|
| 390 |
Ongoing
|
| 391 |
Ongoing
Above is my SQL, somehow I did some mistake when inserting the values.
I want to do a string replace to replace the empty "spaces".
I did the following
update content set status = replace(status,' ','');
It replace 19 rows, then I tried again, it replace 0 rows. but the empty spaces still exist.
How do I solve this using REPLACE()
in MySQL?
Upvotes: 0
Views: 89
Reputation: 197
Found it..
UPDATE content set status = TRIM(Replace(Replace(Replace(status,'\t',''),'\n',''),'\r',''));
Upvotes: 0
Reputation: 985
You're looking for TRIM.
UPDATE FOO set FIELD2 = TRIM(FIELD2);
Upvotes: 1