DELIMITER $$ CREATE function fn_cmax(cn CHAR(20)) RETURNS int DETERMINISTIC BEGIN DECLARE tmp INT; SELECT max(grade) INTO tmp FROM tb_score WHERE cname=cn; RETURN tmp; END $$ DELIMITER ;
DELIMITER $$ CREATE function fn_cmax(cn CHAR(20)) RETURNS int DETERMINISTIC BEGIN DECLARE tmp INT; SELECT max(grade) INTO tmp FROM tb_score WHERE cname=cn; RETURN tmp; END $$ DELIMITER ;