Home > Database > Mysql Tutorial > MySQL分组查询_MySQL

MySQL分组查询_MySQL

WBOY
Release: 2016-06-01 13:18:38
Original
1120 people have browsed it

MySQL查询

分组查询使用group by,对数据进行分组。目的是为了对分组后的数据进行查询。

  select column,group_function

  from table

  [ where condation ]

  [ group by expression]

  [ having group_condation ]

  [ order by column]

  where子句中不能应用group by语句,所以用having对group by出来的分组数据做限制。

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