Concept Flow - Creating stored functions
Start
Define function header
Write function body
Declare variables if needed
Use RETURN to send back result
End function definition
Function ready to use
Call function in queries
Get result from function
You start by defining the function name and parameters, write the body with logic, use RETURN to output a value, then save it. After that, you can call the function in your SQL queries.