常用查询语句的排序 from–>where–>group by–>having–>order by–>select 从这个可以看出来,where里面不能有聚合函数,因为where先已经执行了全排序 from–>on–>join–>where–>group by–>聚合函数–>having–>select–>distinct–>order by–>limit