May 2020
Beginner
564 pages
14h 9m
English
To create a function, you can use the following sample syntax:
DELIMITER $$ CREATE FUNCTION functionname( parameter1, parameter2,… ) RETURNS datatype [NOT] DETERMINISTIC BEGIN -- put sql statements here END $$ DELIMITER ;
To call the function in a SELECT query, you can use the following sample syntax:
SELECT col1, col2, functionname(col3)FROM tablename;
To alter the function, you need to delete it and recreate it with the following sample syntax:
DROP FUNCTION functionname;
Read now
Unlock full access