MySQL How to INSERT INTO [temp table] FROM [Stored Procedure]

前端 未结 5 1134
心在旅途
心在旅途 2020-12-03 13:32

This is very similar to question 653714, but for MySQL instead of SQL Server.

Basically, I have a complicated select that is the basis for several stored procedures.

5条回答
  •  难免孤独
    2020-12-03 14:31

    You cannot "SELECT INTO" with stored procedures.

    Create the temporary table first and have your stored procedure to store the query result into the created temporary table using normal "INSERT INTO". The temporary table is visible as long as you drop it or until the connection is closed.

提交回复
热议问题