我试了下,楼上的做法是可行的,我稍微优化了下,看起来清晰一点。
selectcount(*),
(casefloor((to_char(db_time,'mi'))/15)
when0thento_char(db_time,'yyyy.mm.ddhh')||':00:00'
when1thento_char(db_time,'yyyy.mm.ddhh')||':15:00'
when2thento_char(db_time,'yyyy.mm.ddhh')||':30:00'
when3thento_char(db_time,'yyyy.mm.ddhh')||':45:00'
end)asdb_time
fromtable
groupbydb_time