使用临时表“无法重新打开表:'临时\u name'时发生mysql错误”

2024-07-03 07:26:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用python调用一个创建临时表的存储过程

然后我试图从那个表中选择,但是得到了错误

Caught an exception while rendering: (1137, "Can't reopen table: 'temporary_name'")

谁能看出我错在哪里吗

我的代码是

^{pr2}$

这个表不是临时的,我只是把它放进去


Tags: 代码namean过程错误tableexceptioncan
1条回答
网友
1楼 · 发布于 2024-07-03 07:26:05

MySQL documentation(参见粗体文本):

You cannot refer to a TEMPORARY table more than once in the same query. For example, the following does not work:

mysql> SELECT * FROM temp_table, temp_table AS t2;
ERROR 1137: Can't reopen table: 'temp_table'

This error also occurs if you refer to a temporary table multiple times in a stored function under different aliases, even if the references occur in different statements within the function.

相关问题 更多 >