题解 | #查找字符串 10,A,B 中逗号,出现的次数cnt#

用原字符串长度减去将逗号替换成空的字符串长度

char_length(): 字符串的字符长度

length(): 字符串的byte长度

原来select可以空选啊。。。

select char_length("10,A,B")-char_length(replace("10,A,B", ",", ""))
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务