group by;having;order by

1.order by 1,2,3  和  order by 3,2,1  的结果不同

2.having 不能使用别名 ;order by 中可以使用别名

    在oracle中的执行顺序:

      select_list >  where > group by > having() > alias > order by

3.group_by_list 可以不出现在select_list

4.select_list 如果不出现在 group_functon中,就必须出现在 group_by_list中;

原文地址:https://www.cnblogs.com/sisier/p/4658369.html