正确答案✅:用group by就可以了哇。
创建测试数据:
ALTER SESSION SET nls_date_format = 'YYYY-MM-DD HH24:MI:SS';
SQL> create table test (id number,date1 date);
Table created.
SQL>
SQL>
SQL> insert into test values(1,sysdate-1/8);
1 row created.
SQL> insert into test values(1,sysdate-1/12);
1 row created.
SQL> insert into test values(1,sysdate-1/14);
1 row created.
SQL> insert into test values(1,sysdate-1/15);
1 row created.
SQL> insert into test values(2,sysdate-1/15);
1 row created.
SQL> insert into test values(2,sysdate-1/13);
1 row created.
SQL> insert into test values(2,sysdate-1/17);
1 row created.
SQL> insert into test values(2,sysdate-1/19);
1 row created.
SQL> insert into test values(3,sysdate-1/19);
1 row created.
SQL> insert into test values(3,sysdate-1/32);
1 row created.
SQL> insert into test values(3,sysdate-1/21);
1 row created.
SQL> insert into test values(3,sysdate-1/8);
1 row created.
SQL>
SQL>
SQL> commit;
Commit complete.
SQL>
SQL>
SQL>
SQL> select * from test;

统计sql:
select id,count(id)
from test
where date1 >= sysdate - 1/8
group by id;

希望能帮助到你!望采纳~