jonathanbull
09-26-2009, 09:37 AM
Hi,
I am looking for a way in which to find the most commonly occurring record in my database. For example, if the contents of a simple db were...
apple
banana
apple
apple
melon
melon
lemon
...the result would be apple. I've managed to achieve the desired affect using a loop, working out the count of each entry. This however feels an extremely uneconomical way of doing things!
Is there any better way of doing this? Any help would be very greatly appreciated. :)
I am looking for a way in which to find the most commonly occurring record in my database. For example, if the contents of a simple db were...
apple
banana
apple
apple
melon
melon
lemon
...the result would be apple. I've managed to achieve the desired affect using a loop, working out the count of each entry. This however feels an extremely uneconomical way of doing things!
Is there any better way of doing this? Any help would be very greatly appreciated. :)
