怎么改这个SQL语句
select T.ZONE as tID ,sum(case when A.PSC_ID is not null then 1 else 0 end) as tTotal from tb_psr_check A
right join (
select '00' as ZONE from tb_psr_check
union select '01' from tb_psr_check
union select '02' from tb_psr_check
union select '03' from tb_psr_check
。。。。。。。。。。。。。。。。。。 (省略)
union select '23' from tb_psr_check ) T
on substr(T.ZONE,1,2)=to_char(psc_check_time,'HH24') group by T.Zone
显示结果如下:
TID TTOTAL
00 3
01 4
02 2
03 5
04 1
05 2
。。。(省略)
23 3
我想添加psc_check_time大于某个时间段,显示结果还是像上面一样,请问怎么改?谢谢