码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-05-12 20:31:24      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:color   sql   聚集函数   包含   sch   school   bsp   tail   details   

转: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 语句用于对结果集进行排序。

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

标签:color   sql   聚集函数   包含   sch   school   bsp   tail   details   

原文地址:http://www.cnblogs.com/Vincent-NMT/p/6846983.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!