"finding the mode"

D

deb

I need a query to find the "mode" (or most frequently
occurring data) within a group. I know that it is
possible in Excel. Can anyone help?
 
D

david epsom dot com dot au

SELECT TOP 1 tbl.str
FROM tbl
GROUP BY tbl.str
ORDER BY Count(tbl.str) DESC;


more difficult of course if it's bi-modal... but then, isn't it always?

(david)
 
Top