Home >Database >Mysql Tutorial >mysql中Group By 如何统计

mysql中Group By 如何统计

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 09:44:381248browse

mysql

数据如下:
访问时间 离开时间
2014-1-1 2014-1-2
2014-1-3

2014-2-1 2014-2-2
2014-2-8

2014-2-8

2014-3-1 2014-3-5
2014-3-5 2014-3-5

2014-4-1 2014-4-1
2014-4-10 2014-4-2

请问如何用sql计算分组显示,2-3月区间的数据

时间 ---- 访问次数 ---离开次数
2013-2 ----- 3 ----- 1
2013-3 ---2 --- 2

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn