Mysql 左,右

Mysql 左,右,mysql,sql,distinct,Mysql,Sql,Distinct,我有一个带有day列的表,如下所示: 2011-04-28, 2011-04-29 ... day count name surname 2011-04-28 8 titi tutu 2011-04-28 12 tutu toto 2011-04-27 2 tutu toto 2011-03-12 10 tutu toto 我可以得到明确的日期,但不仅仅是月份和年份 select distinct(day

我有一个带有day列的表,如下所示:

2011-04-28, 2011-04-29 ...
day           count  name surname
2011-04-28    8       titi tutu
2011-04-28     12     tutu toto
2011-04-27     2      tutu toto
2011-03-12     10     tutu toto
我可以得到明确的日期,但不仅仅是月份和年份

select distinct(day) from Table where day between "2011-03-01" and "2011-04-28";
我只想要不同的月份和年份

select distinct(day) from Table where day between "2011-03-01" and "2011-04-28";
你能帮我吗


谢谢

DISTINCT可能只应用于mysql中的整行。所以,从约会开始,你首先需要知道你需要什么

select distinct(EXTRACT YEAR_MONTH FROM `day`) from Table 
      where day between "2011-03-01" and "2011-04-28";