试试:
select count(*) from table1 group by month;

解决方案 »

  1.   

    select count(*),month from table1 group by month;
      

  2.   

    重新变一下,是这样的。
    ID           DATE
    11            2003-01-11
    12            2003-01-05
    13            2003-02-05
    1            2004-01-11
    2            2004-01-05
    3            2004-02-05
    4            2004-02-11
    5            2004-02-12
    6            2004-02-16返回的数据要
    2  2003-1
    1  2003-2
    2  2004-1
    4  2004-2日期转换处理我没有问题,但统计有问题,看看哪位能够解决
      

  3.   

    selete substr(Date,1,7),count(ID) 
    from table1
    group by substr(Date,1,7)
    order by subStr(Date,1,7)
    也可先写个子查询,把日期处理好,再统计
      

  4.   

    select count(id), month
    from 
    (
        select id, to_char(month, 'YYYY-MM')
        from yourTable
    )
    group by month
    order by month
      

  5.   

    select count(*),to_char(date,'yyyy-mm') month from table1 group by to_char(date,'yyyy-mm');