Mode in SQL
13. May 2007 12:11Mode
A mode is type of statistic that refers to the most frequently occurring value in a sample set.
Calculating a Mode
Problem
You want to calculate a modal average of the bulb-life results in your database.
Solution:
SELECT COUNT(*) frequency,Hours mode FROM BulbLife GROUP BY Hours HAVING COUNT(*)>= ALL( SELECT COUNT(*) FROM BulbLife GROUP BY Hours)

Email 