In CF, I'd use ValueList to put the database field's values into a list, then
use ListValueCount to see how many times each value occurs, and then use Max to
get the largest count. Finally, you'd look back in the list to grab the value
which had that max count.
Not a bad idea for a custom tag or a UDF.
-David
On Tuesday, February 27, 2001 1:24 PM, Albert, Gregory Mitchell (Greg)** CTR **
[SMTP:[EMAIL PROTECTED]] wrote:
> Does anyone know of a way to get the mode (the most frequently occuring
> number) for a column? I didn't see any sort of SQL function for this, but it
> would be a useful function, if someone had an idea of how to do it with CF.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists