Created
April 5, 2012 01:08
-
-
Save tomill/2307102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select round(avg(sec)) as avg, max(sec) as max from foo; | |
select sec as mode from (select sec, count(*) as c from foo group by sec ) as t order by c desc limit 1; | |
select @mednum := floor(count(*) / 2) from foo; | |
set @rownum = 0; | |
select sec as median from (select @rownum := @rownum + 1 as rownum, sec from foo order by sec) as t where rownum = @mednum; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment