-How to get percentage of each group?
MiaoMiao 2012-09-07, 05:23
I have a table, containing userId and userType.
I want to get percentage of each userType.
My current solution:
1. Get count of each group via THRIFT
2. Calculate each userType using other programming language like PHP.
This solution is fine, but I'm just curious, is there a way to do it
in one query?
I know this query works in mysql, but not hive.
, count(1)/(select count(1) from some_table)