orcal 根据打分时间计算打分情况

create or replace function F_GET_TEST(in_ny in date,in_project_id in number
)
return number is
sReturn number(17,2);

/*
功能:测算“项目质量分数”,
入参:in_ny 月份 SCM_MDM_WBS_MONTH对应月份 与项目
in_project_id:项目id


返回:返回测算的值

*/


begin

--直接用项目报工总天数除以绩效团队报工天数
select 100+ nvl(sum(nvl(t.source,0)),0) into sReturn from SCM_MDM_QUALITY_SCORE t where t.project_id=in_project_id and to_char(t.create_date,'YYYYMMDD')<= to_char(in_ny,'YYYYMMDD')and t.use_flag='Y' ;
return sReturn;

end;

原文地址:https://www.cnblogs.com/zhangzhiqin/p/9240103.html