日期:2014-05-17 浏览次数:20851 次
with m as
(select rownum s_date from dual connect by rownum between 1 and 12)
select m.s_date,
case
when t.num is null then
0
else
t.num
end
from m
left outer join (select count(*) num,
to_char(t.t_checktime, 'mm') as checktime
from temperature t,
students s,
eduorganization e ,
province p
where t.t_checktime >= to_date( '2013-01-01 00:00:00' ,'yyyy-mm-dd hh24:mi:ss')
and t.t_checktime < to_date( '2013-12-31 23:59:59' ,'yyyy-mm-dd hh24:mi:ss')
and t.temperature >= 36 and t.temperature <= 37.5
and t.stu_obid = s.id
and s.organization_obid = e.id
&n