select count(a) from t1 group by a; select sum(a) from t1 group by a;