如何在MySQL中,直接保存存储过程结果到一个临时表,然后在此基础上再次查询?
DROP TABLE IF EXISTS temptable;
CREATE TEMPORARY TABLE temptable
SELECT ...
FROM ...
WHERE ...
ORDER BY ...;
SELECT * FROM temptable;