SQL group by date (hour)

后端 未结 4 831
鱼传尺愫
鱼传尺愫 2021-02-01 06:33

I have a Table with a \"Date\" Column. I want to group by hour for a specific date.

4条回答
  •  北海茫月
    2021-02-01 07:00

    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
    

提交回复
热议问题