所以我的问题非常简单:
我在SQL中有一个列,它是一个以逗号分隔的列表(即cats,dogs,cows,)我需要仅使用sql 来计算其中的项目数(因此无论我的函数是什么(现在让我们称之为fx)都会像这样工作:
SELECT fx(fooCommaDelimColumn) AS listCount FROM table WHERE id=...
Run Code Online (Sandbox Code Playgroud)
我知道那是有缺陷的,但是你明白了(顺便说一句,如果值fooCommaDelimColumn是cats,dogs,cows,,那么listCount应该返回4 ......).
就这些.