题目链接:
思路:
首先算出 “10,A,B” 的长度,然后使用 replace 函数替换掉逗号,然后计算差值就是逗号的次数:
select (length("10,A,B") - length(replace("10,A,B", ",", "")))
题目链接:
思路:
首先算出 “10,A,B” 的长度,然后使用 replace 函数替换掉逗号,然后计算差值就是逗号的次数:
select (length("10,A,B") - length(replace("10,A,B", ",", "")))