我有这张桌子:
| name | gender | date |
------------------------------------
| Foo | male | 2013-09-16 10:23 |
| Name | male | 2013-09-16 09:10 |
| Red | male | 2013-09-15 09:10 |
| Bar | female | 2013-09-15 10:10 |
etc...
我需要通过过滤来获取一周中每一天的访问次数gender
。
所以我应该得到,如果我计算男性:
1: 2 visits
2: 0 visits
3: 0 visits
4: 0 visits
5: 0 visits
6: 0 visits
7: 1 visit
查询应该是:
SELECT FROM table
WHERE gender = 'male'
GROUP BY DAYOFWEEK
我的查询不起作用,所以我在这里问是否有人知道如何使它起作用......