mysql活动查询,mysql中按照日期分组查询数量

更新时间:01-27 教程 由 冷瞳 分享
mysql活动查询,mysql中按照日期分组查询数量?

SELECT DATE_FORMAT(time,'%Y-%m-%d') as day, sum(case when amount>0 then amount when amount=0 then 0 end) as amount1from table where time>='2014-11-01' group by day;我没有测试。time表示日期,amount表示数量。查询11月后每天成交数量

声明:关于《mysql活动查询,mysql中按照日期分组查询数量》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2210501.html