I have a follow up question on the link below. Apparently I have to create a new question (Sorry if I should not, I am new to stackoverflow)
One of the responses to the issue was this:
SELECT sql_text INTO @sql FROM sql_queries WHERE id = 1;
PREPARE sql_query FROM @sql;
EXECUTE sql_query;
It helped if I run the above line by line, but I want to run this as a whole and use the result in another query. So my issue is the following:
1 - It doesn't work if I remove the semicolons and try to run the three lines at the same time.
2 - How can I read the results of this run into a query. I was thinking of putting all three lines in a subquery, but that didn't work.
I appreciate if you have any comment on those. Thanks!