Sql 获取配置单元中每个单词的唯一字数
我有一张如下的桌子 从tablename中选择*Sql 获取配置单元中每个单词的唯一字数,sql,hadoop,hive,Sql,Hadoop,Hive,我有一张如下的桌子 从tablename中选择* ID sentence 1 This is a sentence 2 This might be a test 3 America 4 This this 我想写一个查询,将句子拆分成单词,并按降序计算单词数。我想要一个输出,比如 word count Unique
ID sentence
1 This is a sentence
2 This might be a test
3 America
4 This this
我想写一个查询,将句子拆分成单词,并按降序计算单词数。我想要一个输出,比如
word count Unique(ids)
This 4 3
a 2 2
might 1 1
.
.
.
其中count是该单词在列中出现的次数,Unique(ids)是使用该单词的用户数
我在想,我们可以用什么方式编写查询来实现这一点
有人能帮我在蜂箱里做这个吗
谢谢侧视图
结果将是:
1 This
1 is
1 a
1 sentense
2 This
2 might
2 be
2 a
2 test
3 america
聚合结果侧视图
结果将是:
1 This
1 is
1 a
1 sentense
2 This
2 might
2 be
2 a
2 test
3 america
聚合结果我删除了不适当的数据库标记。我删除了不适当的数据库标记。