group by和having注意事项

执行和编写顺序:join->where->group by->having

其中where与having的区别:

where用于在group by分组之前过滤掉某些行,

group by对where过滤之后的行数据进行分组,

having用于过滤掉不符合条件的组。

https://blog.csdn.net/Shine_rise/article/details/54934242

posted @ 2018-06-15 11:27  morein2008  阅读(1070)  评论(0编辑  收藏  举报