select cast((b.title || 0) as char) as name, nvl(total,0) value from( select substr(to_char(wfsj,'yyyy-MM-dd hh24'),12,2) title,count(1)? total from jgxt_jtwfcfxxb group by substr(to_char(wfsj,'yyyy-MM-dd hh24'),12,2)) a? right join (? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?这里是序列 select substr(to_date(sysdate, 'yyyy-MM-dd')-seq_hour/24 ,12, 2) ?as title from( select a from? (select '1' as a from dual union select '2' from dual? union select '3' from dual ?union select '4' from dual ) ?a? join (select '1' from dual union select '2' from dual ?union select '2' from dual union select '3' ?from dual union select '4' from dual union select '5' from dual ?union select '6' from dual) ?b on 1 ) as b, (select -1 as i from dual) ) b? on a.title = b.title
|