select time,count(*) from table group by time order by time
类似的哦 最终查出的结果是:
0-4 5 4-8 8 等等 后面的是我虚拟的count。
不一定是time 但肯定是数字。
select time,count(*) from table group by time order by time 单纯按照这种查
他仅仅显示是同一时间的数量。所以 想弄时间段里的,希望知道的告诉我。谢谢哦这个要求和分析函数没什么关系 试试这样写 select trunc(time)+trunc((time-trunc(time))*6)/6,count(1) from table1 group by trunc(time)+trunc((time-trunc(time))*6)/6 order by 1 SQL code: select time , count(1) from ( select case when time >= 0 and time < 4 then '0-4' when time >= 4 and time < 8 then '4-8' when time >= 8 and time < 12 then '8-12' end time from table ) t group by time
select trunc(d1), round(to_number(to_char(d1,'HH24'))/4),count(*) from ( select sysdate d1 from dual ) a group by trunc(d1), round(to_number(to_char(d1,'HH24'))/4)