日期:2014-05-16  浏览次数:20912 次

mysql 把select结果保存为临时表,有2种方法

mysql 把select结果保存为临时表,有2种方法
第一种,建立正式的表,此表可供你反复查询
drop table if exists a_temp;
create table a_temp as
select 表字段名称 from 表名称

或者,建立临时表,此表可供你当次链接的操作里查询.
create temporary table 临时表名称
select 表字段名称 from 表名称