【发布时间】:2013-09-16 14:51:27
【问题描述】:
我喜欢在 MySQL 中加入一个失败的临时表,这个想法很简单:
CREATE TEMPORARY TABLE temp_table LIKE any_other_table; -- srsly it does not matter which table
(
SELECT p1,p2,p3 FROM temp_table WHERE p4 = 1
) UNION (
SELECT p1,p2,p3 FROM temp_table WHERE p4 = 2
)
非常感谢任何帮助。
编辑:mysql抛出的错误是ERROR 1137 (HY000): Can't reopen table: 'temp_table'
【问题讨论】:
标签: mysql sql join temp-tables