I have a table like this:
person_id food data
1 bread xxx
1 bread xxx
1 fruite xxx
2 bread xxx
2 fruite xxx
food can have only three values (bread, fruits), I want to get the percentage of bread each person has eaten, and there percentage of fruits each person has eaten.
I tried to do:
select count(*) from table
group by person_id, food
and that gives me:
player_id, food, number
but how can I continue from now?
I am on hadoop