Hi all,
Basically I am wanting to find the most common value entered in a field, but I cant seem to find what I am after. Have searched all over but it is very hard to find something when you dont know if it can even be done.
All I can seem to get going is an average, which returns the result of a calculation as opposed to an actual row value.
Thanks.
Function for finding most common entries
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
SELECT *, COUNT(field) `duplicates` FROM table GROUP BY field ORDER BY COUNT(field)