s.fruit | fruit |
---|---|
Cucumber | apple |
apple | Mango |
Orange | grape |
grape | apple |
My output need to be the count be of the total fruit.
apple:3,
Mango :1,
grape:2,
Cucumber:1,
orange:1.
This is what i tried which is not correct so how to do this ? any idea?
select s.fruit,fruit, count(*)
from grocery
group by s.fruit,fruit