开发者

strip all spaces from column in mysql?

开发者 https://www.devze.com 2023-01-08 01:47 出处:网络
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?

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

精彩评论

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