sql截去字段中后三位以_yz结尾的记录:
update `x2`.`pre_common_member` set username= left(username,char_length(username)-3) where username like '%\_yz%' order by uid asc;
【如果字符串包含中文,不用length而用char_length计算字符串长度。like中下划线用右斜线\转义】
除非注明,均为湛蓝天空原创,转载请注明本文网址:http://skyhome.cn/sql/505.html