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,' ','')

原文地址:https://www.cnblogs.com/weixin18/p/10844276.html