您可以使用一个非常丑陋的查询来执行此操作。
select word, count(*) from (select (case when instr(substr(m.comments, nums.n+1), ' ') then substr(m.comments, nums.n+1) else substr(m.comments, nums.n+1, instr(substr(m.comments, nums.n+1), ' ') - 1) end) as wordfrom (select ' '||comments as comments from m )m cross join (select 1 as n union all select 2 union all select 3 ) numswhere substr(m.comments, nums.n, 1) = ' ' and substr(m.comments, nums.n, 1) <> ' ') wgroup by wordorder by count(*) desc
这是未经测试的。内部查询需要一个数字列表(此处限制为3;您可以了解如何添加更多数字)。然后检查单词是否在位置n +
1处开始。空格后是一个单词,所以我在注释的开头加了一个空格。
然后,出于聚合目的将其删除。



