【发布时间】:2015-02-20 18:48:49
【问题描述】:
为什么我不能创建一个临时表然后立即加入它?
mysql> CREATE TEMPORARY TABLE table2 as (select in_reply_to_id, COUNT(in_reply_to_id) as C from mentions where in_reply_to_id>0 group by in_reply_to_id);
查询正常,57149 行受影响(0.14 秒) 记录:57149 重复:0 警告:0
mysql> select T.tweet_id, T.favorite_count, T.retweet_count, T2.C from
-> tweets AS T JOIN table2 AS T2
-> on T.tweet_id = T2.in_reply_to_id;
错误 1146 (42S02):表“twitter_analysis.table2 as”不存在 mysql>
但它确实存在,因为我可以从中选择!
select count(*) from table2;
57149 1 行(0.01 秒)
这个错误非常令人沮丧。 有没有办法将此临时表放入选择查询中?
【问题讨论】:
标签: mysql