counting word occurances



apple
orange
pear
pear
magno
apple

Given the following data can someone show me example code on how to count
how many of each different fruit

ie.

output should be somehting like

apple 2
orange 1
pear 1
mango 1

Note this isnt homework or anyting.



.



Relevant Pages

  • Re: Make one list from 2 unique quiries
    ... Select Column1 as Fruit from table 1 ... (might have to try a Union ALL and look at select distinct, ...
    (microsoft.public.access.queries)
  • Re: opinions on logical OR variation
    ... However, presumably a product cannot be both an apple and an orange, ... #define PEAR 3 ... #define PLUM 4 ... > void do_something ...
    (comp.lang.c)
  • Re: counting word occurances
    ... Well, assuming @foo contains the list of fruit, then ...
    (comp.lang.perl)
  • Re: fruit and vegitables
    ... Nicky wrote ... > Alan Hardy wrote ... >> Half a pear or apple? ... > I haven't eaten a pear since about 2 months after dx, ...
    (alt.support.diabetes)
  • The World of Fruit Labels
    ... The web's first fruit label site. ... 4015 Cape Late Top Red [apple] ... 4173 Copefrut ROYAL GALA [apple] ... 4408 Asian Pear ...
    (rec.gardens)