I do not think you can use the result of a stored procedure in an ad-hoc subquery.
On my social network, LetsGetNuts.com, I have a Friend table. This is the structure:
mysql> describe Friend;
+—————-+—————+——+—–+———+——-+
| Field | Type | Null | Key | Default | Extra |
+—————-+—————+——+—–+———+——-+
| fkUser | int(11) | YES | MUL | NULL | |
| fkFriend | int(11) | YES | MUL | NULL | |
| confirmed | enum(’Y',’N') | YES | MUL | NULL | |
| confirmed_date | date | YES | | NULL | |
+—————-+—————+——+—–+———+——-+
4 rows in set (0.02 sec)
The issue here is that building a list of the friends of a certain user involves using a UNION, and I frequently need to use the concept of IN (FRIENDSLIST). I was …
[Read more]