I have a routine that is called using
SET @p0='55'; SET @p1='-6'; SET @p2='100'; CALL `distanceSearch`(@p0, @p1, @p2);
Basically i pass in latitude, longitude and a distance to search for users, e.g 100 miles. The routine creates a temp table and inserts results into it. When i execute it, a result set is returned.
When i try execute it like this i run into a syntax error
SET @p0='55'; SET @p1='-6'; SET @p2='100';
select foo.* from (CALL `distanceSearch`(@p0, @p1, @p2)) as foo
What am i doing wrong? How do use the results from this to join on another table?