峰云科技网
您的当前位置:首页MySQL分组查询_MySQL

MySQL分组查询_MySQL

来源:峰云科技网


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出来的分组数据做。

显示全文