mysql关于临时表的联查问题

wohenni0931 2015-04-15 11:20:27
存储过程中的代码:
create temporary table temp1 select id,name from mytable1;
select a.id from (select * from temp1) a
left join (select * from temp1) b on a.id = b.id;

这种情况下 为什么没有查询结果?

如果是 left join (select * from mytable1) b on a.id = b.id 时 就有结果返回

请大神分析一下 ,本人新手分少,请见谅
...全文
403 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
SQL77 2015-04-15
  • 打赏
  • 举报
回复
create temporary table temp1 select id,name from mytable1; select * from temp1 有结果么
microhex 2015-04-15
  • 打赏
  • 举报
回复
拉不出来溜溜啊。。。。
ACMAIN_CHM 2015-04-15
  • 打赏
  • 举报
回复
楼主是在什么中执行的? 建议提供测试用例。
SQL77 2015-04-15
  • 打赏
  • 举报
回复
引用 2 楼 wohenni0931 的回复:
select * from temp1有结果
能给文本结果么? 按逻辑上来说是不可能的
wohenni0931 2015-04-15
  • 打赏
  • 举报
回复
select * from temp1有结果

56,678

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧