how to take the standard deviation and sum of a count(*) result column

I have a table as such:

firstname  lastname   values
john       doe        first
john       doe        second
john       doe        third
joe        public     first
joe        public     second
robert     willians   first
robert     willians   second

I would like to count the number of times each firstname, lastname pair occurs. then calculate the sum, average, and standard deviation of the count column.

Currently, I have:

select stddev(t.count(*)), avg(t.count(*)), sum(t.count(*))
   from (select count(*), firstname, lastname
      from table
      group by firstname, lastname) t

This gives

unknown user-defined functions t.”count()”,t.”count()”,t.”count(*)”

Answer

Just use a more meaningful column alias:

select stddev(t.cnt), avg(t.cnt), sum(t.cnt)
from (select count(*) as cnt, firstname, lastname
      from table
      group by firstname, lastname
     ) t