Addressed to: Dale Frohman <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from Dale Frohman <[EMAIL PROTECTED]> Thu, 22 Feb 2001 10:34:47 
-0500 (EST)
> Is there anyway with a mysql query to find which item in a particular
> field in a table occurs the most frequently?
> ie:
> table things
> field morethings
> item1
> item2
> item1
> item1
> I would like a query that runs and pulls whatever occurs the most.  In
> this case "item1"

Contrary to popular opinion, MySQL is quite powerful, and can do quite a
bit more than some seen to think around here.  Grumble, grumble.  You
can learn a lot from few hours reading the F* manual.

Try this:

   SELECT COUNT(*) AS Count, morethings
   FROM things
   GROUP BY morethings
   LIMIT 1


| Count | morethings |
|     3 | item1      |

Rick Widmer
Internet Marketing Specialists

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to