0
創建這個函數此給予錯誤:我嘗試在SQL
#1064 - 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 'TABLE where studentid=id); IF(@sid = 'INDIAN') THEN SET @data:= (s' at line 6
CREATE FUNCTION `dbu_application`.`atudentfee` (id int,code varchar(255))
RETURNS int(11)
BEGIN
SET @sid := (SELECT TYPE FROM TABLE where studentid=id);
IF(@sid = 'INDIAN') THEN
SET @data:= (select data from table2 where progcode='code');
ELSE set $data:=0;
END IF;
RETURN @data;
END$$