17,086
社区成员
发帖
与我相关
我的任务
分享
create table table_name(
yyb_name varchar2(50),营业部名称
start_date number(8),--开始时间
end_date number(8),--结束时间
count_users number(10)--有效户数合计
)
create or replace procedure proc_name(f_month in number,l_month in number)
/**************
f_month为开始日期默认为年初话,如201001
l_month为结束日期
在这里用number类型了
**************/
is
insert into table_name--中间表
(yyb_name,营业部名称
start_date,--开始时间
end_date,--结束时间
count_users--有效户数合计)
select yyb,
f_month,
rq,
count(ywlb)
from your_table_name y
where y.rq <= l_month
and y.rq >= f_month
and y.ywlb = '190';
commit;
......
--你的其他需求
end;