日常运营中,有的时候我们需要将某些字段中包含中文的数据查出来。则可以通过以下方法:
原理: 当字符集为UTF-8,并且字符为中文时,length()
和 char_length()
两个方法返回的结果是不相同的。
select * from ma_picture where length(fileurl)!=char_length(fileurl)
日常运营中,有的时候我们需要将某些字段中包含中文的数据查出来。则可以通过以下方法:
原理: 当字符集为UTF-8,并且字符为中文时,length()
和 char_length()
两个方法返回的结果是不相同的。
select * from ma_picture where length(fileurl)!=char_length(fileurl)