SQL建立成績方法
delimiter
$$
create
function grade(score int)
returns
char;
begin
delclare
gd char(1);
if
score =300 then
set
gd=”A”;
elseif
score Between 280 and 299 then
set
gd=”B”;
elseif
score Between 250 and 279 then
set
gd=”C”;
elseif
score Between 200 and 249 then
set
gd=”D”;
elseif
set
gd=”E”;
end
if;
return
gd;
END
$$
delimiter
;
留言
張貼留言