题解 | #计算男生人数以及平均GPA#
计算男生人数以及平均GPA
http://www.nowcoder.com/practice/7d9a7b2d6b4241dbb5e5066d7549ca01
使用分组,然后对分组值进行过滤,having 等同于where,where使用于现有值进行过滤,having 使用于对未在表中出现的值(分组)进行过滤 select count(gender),avg(gpa) from user_profile group by gender having gender="male