我现在有两张表,一张是体温表,一张是员工表,分别如下:
体温表:
t_id e_obid t_checkdate t_temperature
1 1 2012-3-2 11:11:11 36
2 1 2012-3-3 12:11:11 37.5
3 2 2012-3-2 11:11:11 36.5
4 2 2012-3-3 12:11:11 38
员工表:
e_id e_name
1 小李
2 小陈
我想在oracle写一个存储过程实现传入年份,得到这一年每个月体温大于37的人次,如果没有的话就显示0,预想的效果是这样:
日期 异常人次
2012-1 0
2012-2 0
2012-3 1
.
.
2012-12 0
先谢谢了!
------解决方案--------------------
create or replace package pkg_test is
procedure year_test(results_out out sys_refcursor,v_year in integer);
end pkg_test;
create or replace package body pkg_test is
procedure year_test(results_out out sys_refcursor, v_year in integer)
is
begin
open results_out for
with m as ( --这个临时表如果能事先建好,一句sql就可以了
select to_date(v_year
------解决方案--------------------