create funtion tra (g_name varchar(10))
returns int
begin
declare gpa int;
set gpa = 0;
gpa = case
when g_name = 'A+' THEN 5
when g_name = 'B+' THEN 4 ELSE 3
END CASE;
RETURN gpa; end;//
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'funtion tra (g_name varchar(10)) returns int begin declare gpa int; set gpa ' at line 1
what is error in declare?
function
, notfuntion
. – GMB