Home > Database > Mysql Tutorial > body text

mysql中order by与group by的区别_MySQL

WBOY
Release: 2016-06-01 13:25:17
Original
1513 people have browsed it

bitsCN.com order by 从英文里理解就是行的排序方式,默认的为升序。 order by 后面必须列出排序的字段名,可以是多个字段名。     
group by 从英文里理解就是分组。必须有“聚合函数”来配合才能使用,使用时至少需要一个分组标志字段。 
什么是“聚合函数”? 
像sum()、count()、avg()等都是“聚合函数” 
使用group by 的目的就是要将数据分类汇总。bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template