写的顺序:select ... from... where.... group by... having... order by..执行顺序:from... where...group by... having.... select ... order by...
https://www.cnblogs.com/ldcs/p/11749226.html