Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
select @Stddev = ( select STDEV(colA) from Table1 )
@median =
(
SELECT x.Timer
FROM Table1 x, Table1 y
GROUP BY x.Timer
HAVING
SUM(CASE WHEN y.Timer <= x.Timer
THEN 1 ELSE 0 END)>=(COUNT(*)+1)/2 AND
SUM(CASE WHEN y.Timer >= x.Timer
THEN 1 ELSE 0 END)>=(COUNT(*)/2)+1
)
select @stderr =
(
select STDEV(Timer)/SQRT(COUNT(*))
from Table1
)
-- sample data. groupcol is column for GROUPing BY
create table blah (groupcol int, n float)
insert into blah select 1, 5.0
insert into blah select 1, 6.0
insert into blah select 1, 8.0
insert into blah select 1, 9.0
insert into blah select 2, 42
insert into blah select 3, 9.0
insert into blah select 3, 100.0
-- check results (SQL2k)
select groupcol, stdev(n)
from blah
group by groupcol
-- simulated STDEV
select sqrt((cnt*sumsq - sumn*sumn)/(cnt*NULLIF(cnt-1, 0)))
from
( select groupcol, count(n) as cnt, sum(n) as sumn, sum(n*n) as sumsq
from blah
group by groupcol
) X
-- clean up sample data
drop table blah