有人可以指出我做错了什么吗?我正在尝试根据下表创建一个排名程序:
这是代码:
create or replace procedure rank
(para_userid IN number, USERID IN number)
is
rank number;
v_userid number;
begin
v_userid := &USERID;
select v_userid, sum(decode(a.rank, 'SU', 25, 'EX', 9, 'VG', 5, 'G', 3, 'F',1) * b.tokens) / sum(b.tokens)
into rank
from a.GameID = b.GameID
where para_userid = v_userid;
return rank;
end;
declare
x number;
begin
x:=rank(&USERID);
DBMS_OUTPUT.PUT_LINE('User Ranking is: '||x);
end;
/