select date,count(*) from tbName
group by date
order by date;

解决方案 »

  1.   

    Sorry,楼上回复时没看到你的要求,哪就要使用游标了,等一下我再给你。
      

  2.   

    select a.alldate,count(b.date) from
    (select (to_date('2005 04 01','yyyy mm dd') + rownum - 1) alldate from all_objects where rownum < 31) a,tbname b
    where a.alldate = b.date(+) 
    group by a.alldate
      

  3.   


    select a.alldate,count(b.date) from
    (select (to_date('2005 08 01','yyyy mm dd') + rownum - 1) alldate from all_objects where rownum < 32) a,tbname b
    where a.alldate = b.date(+) 
    group by a.alldate