I was not sure how to start the select query in the table, and then return from this function, return several values ββafter they were processed. Also, I did not know whether it is possible to run a SELECT query in a function that returns more than one row. The first answer is that you cannot return an array of data or, I think, more than one line from a function. Therefore, I believe that the best way to do this is to create a temporary table with the returned new dataset.
Example
DROP TEMPORARY TABLE IF EXISTS employeeTemp;
CREATE TEMPORARY TABLE employeeTemp AS
SELECT id, start_date
FROM employee;
Secondly, yes, you can run a SELECT query inside a function to return more than one row.
Sorry, I'm pretty new to MySQL functions.
source share