It is not legal to do max(count())
, so how do I accomplish calculating the contribution as shown here (and also get the other columns)
SELECT id,
Avg(time) AS avgSec,
Stdev(time) AS stdevSec,
Count(time) AS cnt,
Avg(time)*Count(time)/max(Count(time)) AS contribution
FROM ...very long and complex query...