I tried with various version but I am getting the same error message while creating user define functions like this
CREATE FUNCTION avg_month(shop INT) RETURNS DECIMAL
BEGIN
DECLARE
avg_m_sales DECIMAL;
SET
avg_m_sales = 1000;
RETURN avg_m_sales;
END;
The error message is:
Error SQL query:
CREATE FUNCTION avg_month(shop INT) RETURNS DECIMAL
BEGIN
DECLARE
avg_m_sales DECIMAL
MySQL said: Documentation
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4