类似于
SQL> create table testdate(a date,b int);
Table created.
SQL> insert into testdate select date'2019-1-1'+0.1*level ,level from dual connect by level <=20;
20 rows created.
SQL> commit;
Commit complete.
SQL> select * from testdate;
A B
--------- ----------
01-JAN-19 1
01-JAN-19 2
01-JAN-19 3
01-JAN-19 4
01-JAN-19 5
01-JAN-19 6
01-JAN-19 7
01-JAN-19 8
01-JAN-19 9
02-JAN-19 10
02-JAN-19 11
A B
--------- ----------
02-JAN-19 12
02-JAN-19 13
02-JAN-19 14
02-JAN-19 15
02-JAN-19 16
02-JAN-19 17
02-JAN-19 18
02-JAN-19 19
03-JAN-19 20
20 rows selected.
SQL> select count(*), trunc((a-date'2019-1-1')*10)b from testdate group by trunc((a-date'2019-1-1')*10);
COUNT(*) B
---------- ----------
1 1
1 6
1 11
1 13
1 2
1 14
1 20
1 4
1 5
1 8
1 17
COUNT(*) B
---------- ----------
1 3
1 7
1 18
1 9
1 10
1 12
1 15
1 16
1 19