如何使用trim()并更新mysql中的所有行[复制]

This question already has an answer here:

I have a big table in mysql. Around the string in my record is waste space, something like this:

+---------------------------+----------------------------+
|        anything           |           anything         |
----------------------------------------------------------
|        anything           |           anything         |
+---------------------------+----------------------------+

Now i want this:

+--------+--------+
|anything|anything|
-------------------
|anything|anything|
+--------+--------+

In fact i want to use trim() for all rows and update them. how can i do that ?

</div>

As noted in several the comments:

UPDATE sometable SET column1 = TRIM(column1), column2 = TRIM(column2);