开发者

strip all spaces from column in mysql?

i have a table that has

'number'

1234

12 34

1 2 34

1 2 3 4

ect...

so, im wondering how can i write a query that will remove all spaces?

something 开发者_Python百科like

update `table` set number = REPLACE( ' ', '', (select 'number' from `table`));  

is there anything that will do this?


Close. I believe you could write something like this:

update `table` set number = REPLACE( number, ' ', '');


UPDATE table SET number = REPLACE(number, ' ', '')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜