sql中去掉字段的所有空格

字符前的空格,用ltrim(string) 

字符后的空格,用rtrim(string) 

字符中的空格,用replace(string, ' ', ' ')

update qx_users set `NAME`=rtrim(NAME)
update qx_users set `NAME`=ltrim(NAME)
update qx_users set NAME=replace(NAME,' ','')

猜你喜欢

转载自blog.csdn.net/m0_37450089/article/details/83177541