问题描述
我有一个表格,其中列出了一项调查中的自由文本输入,允许参与者输入他们的回答(关于他们希望在婚礼中使用的颜色)
I have a table that lists a freet text input from a survey where enterents were allowed to enter their responses (regarding colours they would like to have in their wedding)
我想写一个sql函数,把这个列的所有信息都收集起来,orders统计每个词出现的频率,按照这个计数对结果集进行排序.
I would like to write a sql function that gathers all the information from this column, and orders counts the frequency of each word, ordering the result set by this count.
我希望上表的顺序如下
我可以在函数运行后去掉所有像and"这样的垃圾词.有谁知道产生这种行为的任何好的功能?
I can strip all the rubbish words like "and" after the function has run. Does anyone know any good functions that produce this behaviour?
推荐答案
好的,这是一种享受.首先是一个分离值的函数......
Okay this works a treat. Firstly a function to separate the values...
然后我就将它应用到我的桌子上...
then I just apply it to my table...
好的,所以我使用嵌套表进行了 OTT,但我已经去除了所有废话字符,分离了值并保留了最常用单词的运行总数.
Okay, so I went OTT with my nested tables, but I've stripped out all the crap characters, separated the values and kept a running total of the most frequently used words.
这篇关于用于在列中显示词频的sql server函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!