Jump to content

get most common value


jpratt

Recommended Posts

Say i have a table with values like the following:

 

ID:      Name:

1        Bob

2        Bob

3        Bob

4        Nick

5        Nick

 

How would i get the value of Bob based off of the fact that it occurs most in the field? Im trying to write a query that selects the three values that occur most in a field. Any ideas? Thanks.

Link to comment
https://forums.phpfreaks.com/topic/106523-get-most-common-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.