CREATE FUNCTION count(name varchar(20))
RETURNS integer
BEGIN
DECLARE d_count integer;
select count(*) into d_count
from ins
where ins.name = name
RETURN d_count;
END
the SQL code above show there is a syntax error.
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 'RETURN (d_count); END' at line 8
Any ideas how to fix it?