Jef*_*emp 53
你也可以这样做:
SELECT TRUNC(datecol, 'HH24') FROM mytable
GROUP BY TRUNC(datecol, 'HH24');
Run Code Online (Sandbox Code Playgroud)
ren*_*ene 28
Select TO_CHAR(date,'HH24')
from table
where date = TO_DATE('20110224', 'YYYYMMDD')
group by TO_CHAR(date,'HH24')
Run Code Online (Sandbox Code Playgroud)
select to_char(datecol,'HH24') thehour, count(*) count_in_hour
from tbl
where datecol = date '20110224'
group by to_char(datecol,'HH24')
order by thehour asc
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
85303 次 |
| 最近记录: |