mysql删除含有中文的数据

有需求需要导入旧用户数据,旧用户用户名含有中文,新的不含中文,需要删除掉这些含有中文的数据

使用如下sql即可

delete  FROM t_user WHERE length(username)!=char_length(username)

length:   返回字符串所占的字节数(受编码影响)
char_length:  返回字符长度。


猜你喜欢

转载自blog.csdn.net/qq_33636325/article/details/79364628