题解 | 用char_length()、replace(),记得是去掉中文逗号!!!
评论替换和去除
https://www.nowcoder.com/practice/0038f5db08a64ec2851f2e219a06a121
char_length():
统计每个字符的数量(包括中文、英文、符号等,1个中文算1个字符)
函数语法:
char_length(str)
str:要处理的字符串
replace():
将字符串中的指定子串替换成新的子串
函数语法:
replace(str,old_substr,new_substr)
str:要处理的原字符串
old_substr:要被替换的子串
new_substr:替换后的新子串
代码:
select id,replace(comment,',','') as comment from comment_detail where char_length(comment)>3;
