只需使用MONTH()和YEAR()函数
SELECt COUNT(*) as `count`, `region`, YEAR(`date`) as `year`, MonTH(`date`) as `month` FROM my_stores.stats WHERe YEAR(`date`) in (2012,2013) GROUP BY `region`, YEAR(`date`),MonTH(`date`)
欢迎分享,转载请注明来源:内存溢出
只需使用MONTH()和YEAR()函数
SELECt COUNT(*) as `count`, `region`, YEAR(`date`) as `year`, MonTH(`date`) as `month` FROM my_stores.stats WHERe YEAR(`date`) in (2012,2013) GROUP BY `region`, YEAR(`date`),MonTH(`date`)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)