How to remove leading and trailing whitespace in a MySQL field?
You’re looking for TRIM. UPDATE FOO set FIELD2 = TRIM(FIELD2); Seems like it might be worth it to mention that TRIM can support multiple types of whitespace, but only one at a time and it will use a space by default. You can, however, nest TRIMs. TRIM(BOTH ‘ ‘ FROM TRIM(BOTH ‘\n’ FROM column)) If … Read more