SQL执行顺序: 表的连接,where ,joingroup byhavingorder bylimit where having 的区别: 分组前去除不满足的记录用where分组后,每组内去掉不满足的用havinghaving 相比于 where ,having条件中能够使用聚集函数