Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Hive 表中有一列 stings,我想计算此列中每个字符串的出现次数。我怎样才能做到这一点?
听起来您需要按列分组,然后计算每个组中的项目数。像这样的东西:
SELECT somecolumn, count(1) AS count FROM sometable GROUP BY somecolumn
我认为正确的查询:
SELECT columnA,columnB,COUNT(distinct column C) from table_name group by columnA,columnB
这个对吗?SQL也很好。