MySQL - Returning "most popular" row
I would like to return the most popular value of a particular field in a mysql database:
For example:
forname, surname, county
------------------------
Alan, Smith, Wiltshire
John, Smith, Hampshire
Eric, Jones, Dorset
I would like to enter the db name (db) and fieldname (surname) and would like the most popular surname returned (or at least a row(s) containing this surname)
I'm using MySQL 4.0.20
All help appreciated
|