mysqlselectcount(需要统计的列(*为统计分组的列))from表groupby统计分组的列如:selectcount(*)fromtestgroupbyname。
- 情感问答
- 答案列表
mysql 统计查询:mysql分组统计查询[朗读]
用子查询:1234select*from(select*fromtablewhereelement1>10)awhereelement2评论000。
selectcount(*)from表名就行了。
selectcount(*),left(creattime,7)asleft7timefromregisterwhere`creattime`like'2012%'groupbylefttime。
selectusername,sum(money)from表名groupby1orderby2desc。