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

猜你喜欢

转载自www.cnblogs.com/aaronhoo/p/9186558.html