是这个吗:
select a,日期,count(a) as cnt 
from tb
group by a,日期

解决方案 »

  1.   

    SELECT count(*) as degree,date1 from test group by a HAVING COUNT(*)>1;
      

  2.   

    SELECT count(*) as degree,date1 from test group by a HAVING COUNT(*)>1;我还要按日期统计,这样是不是没有按日期?
      

  3.   

    按日期?是统计日期相同的还是仅显示出来就行?SELECT count(*) as degree,group_concat(date1 separator ' ')
    from test group by a HAVING COUNT(*)>1
      

  4.   

    id,字段b,日期字段
    1   b1    2005-11-7
    2   b1    2005-11-7
    3   b4    2005-11-8
    4   b1    2005-11-8
    5   b2    2005-11-9
    6   b1    2005-11-9
    7   b1    2005-11-10
    8   b1    2005-11-10
    9   b1    2005-11-10可以看出b1在2005-11-10出现了3次,是最大数据,我要的就是这个
      

  5.   

    取第一条即可
    SELECT count(*) as degree,b,date1
    from test group by date1 order by degree desc;
      

  6.   

    select s.b,dates,m
    from (select b,max(c) as m
          from (select b,dates,count(b) as c
                from tb1
                group by b,dates) q
          group by b) s,
          (select b,dates,count(b) as c
          from tb1
          group by b,dates) t
    where s.m=t.c and s.b=t.b
      

  7.   

    to:数学家id,字段b,日期字段
    1    b1    2005-11-7
    2    b1    2005-11-7
    3    b4    2005-11-8
    4    b1    2005-11-8
    5    b2    2005-11-9
    6    b1    2005-11-9
    7    b1    2005-11-10
    8    b1    2005-11-10
    9    b1    2005-11-10
    10   b2    2005-11-10
    11   b2    2005-11-10
    13   b3    2005-11-10
    14   b1    2005-11-10可以看出b1在2005-11-10出现了4次,是最大数据,我要按时间和b字段同时分组查询,最好是返回所有列?