It's not possible to write Table-Valued Stored procedure in MySQL Server. MySQL Stored Function returns single values only.
However, if the situation demands a Function to return a set of Data, you have only two choices:
- You may create a string using some separators with your result set and return it to the caller.
- Another good alternative is to use Temporary Table.
And please refer the mysql doc too.