having 和where 都是用来筛选用的 having 是筛选组 而where是筛选记录 他们有各自的区别 1》当分组筛选的时候 用having 2》其它情况用where 用having就一定要和group by连用, 用group by不一有having (它只是一个筛选条件用的)