GROUP BY 和 ORDER BY一起使用时,要注意的问题!

转:http://blog.csdn.net/haiross/article/details/38897835

注意:ORDER BY 子句中的必须包含在聚合函数或 GROUP BY 子句中

http://www.w3school.com.cn/sql/sql_groupby.asp 聚集函数 (比如 SUM) 常常需要添加 GROUP BY 语句。

http://www.w3school.com.cn/sql/sql_orderby.asp ORDER BY 语句用于对结果集进行排序。

posted @ 2017-05-12 19:22  Vincent_NMT  阅读(651)  评论(0编辑  收藏  举报