我在这个网站上找到了这个查询(虽然稍微修改了一下),它工作正常。但是,结果集没有显示 count(*) 为 0 的范围间隔。我尝试将 NVL 函数与左关节一起使用,但无法使其工作。有任何想法吗?(见下面的查询)
谢谢
select
count(*) "# PRs Created",to_char(date_created, 'yyyy-mm-dd') as "Date Created",
to_char(date_created, 'hh24') || ':00:00 - ' || to_char(date_created + 1/24, 'hh24') || ':00:00' RANGE
FROM pr
where date_created between to_date(SYSDATE - 1000)and to_date(SYSDATE)
and 1 * to_char(date_created, 'hh24') between 0 and 24
group by to_char(date_created, 'hh24'), to_char(date_created + 1/24, 'hh24'),to_char(date_created, 'yyyy-mm-dd')
order by to_char(date_created, 'yyyy-mm-dd'), RANGE desc