21,887
社区成员
发帖
与我相关
我的任务
分享
create temporary table k select a.value as aval,a.id as aid,b.value as bval from a,b where a.value=b.value;
select * from k;
否则会有两个value,导致出错。#1060 - Duplicate column name 'value'
create temporary table k(
`a` varchar(20) NOT NULL,
`aid` int(11) NOT NULL,
`b` varchar(20) NOT NULL
);
insert into k(a,aid,b) select a.value,a.id,b.value from a,b where a.value=b.value;
select * from k;
create temporary table k select a.value,a.id,b.value from a,b where a.value=b.value
不过临时表只能生存在当前连接中
版主大人救命啊,我我只是想将查询到的结果作为一张临时表k存放起来而已的,很简单的
[/quote]