?需求就是---》如果该考生学习经历中没有没有拿到过或者拿到过一次硕士学位则不加分,而两次则加一分,然后多一次加一分;
?
?-- identify为身份证号码
create or replace function NJUTEC_GETSSXWSCORE(identity in varchar2) return number is
? Result number;
? cnts? number := 0;
begin
? select count(1) into cnts
? from PERSON_DEGREE_INFO t where t.identify = identity? and t.xwname = '02';??? --xwname=02为硕士类型
?????? if(cnts > 1)
???????? then
?????????? Result:=cnts*1-1;
???????? else
?????????? Result:= 0;
?????? end if;
? return(Result);
end NJUTEC_GETSSXWSCORE;
?
?
测试:select NJUTEC_GETSSXWSCORE('111111111111111111') from dual;