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。