I agree, I don't think there is a function in MySql, it will do the job. 
May be you can use the following algorithm

1. fetch all rows item description.
2. Split into words and put it in a array.
3. Create a counter array of the same limit of word array.
4. in a for loop, count number of time that particular word occur. Every 
time it occurs increase the counter and set the matched field to blank.

By setting the feild to blank, you check if the feild is not blank do 
the progressive count, if not skip to the next word. This will increase 
the speed of your counting process.

Just a thought.

Steve Ruby wrote:

> Dale Frohman wrote:
> 
>> Is there anyway to do a query and search for the most frequent
>> word that appears in a particular field in a table?
>> 
>> ie:
>> 
>> ITEM DESCRIPTION
>> ----------------
>> 
>> Blue Dog
>> Red Dog
>> Yellow Cat
>> 
>> I would want to spit out "Dog" as being the most reoccuring word.
>> 
>> Thanks
> 
> 
> 
> that's a little beyond the scope of sql.. you'd have to write your
> own stuff to make several queries and find the most used word..
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 

Reply via email to