Can I make a userdefined function/procedure to return a result set

1. http://forums.mysql.com/read.php?10,230291,230303#msg-230303
> Can I make a user-defined function return a tabular result.(say, a list of person name) No.
Put the list in a temp table, and use a left exclusion join rather than IN() (see "The unbearable slowness of IN()" at http://www.artfulsoftware.com/infotree/queries.php).
....Read the fine manual. A temp table is connection-specific.
2.
".....Not using the return statement,no. To save it for use eslewhere, save the result in the spro to a temp table and return the  temp table name...."
The above solution is suggested by a net friend in one of my post on a web site. However, I failed to find the old post again for reference. The solution is a good trick/ workaround to make a procedure/function to return a result set. Without this solution, I hardly give up using MySQL as the data mangament system in my project-- I would like to use Oracle, as in Oravle making a procedure/function return a result set is a simple thing. 
原文地址:https://www.cnblogs.com/cy163/p/1314628.html