mysql创建临时表

快速创建

-- 快速创建表aaa
create temporary table aaa(id int) ;
create temporary table aaa(id int, index(id)) engine=innodb;

-- 向临时表插入数据
insert into aaa  select a.id
from answer1 a,
     answer1 b
where a.subject_id = b.subject_id
  and a.subject_no = b.subject_no
  and a.option_name = b.option_name
  and a.group_name = b.group_name
  and a.user_answer = b.user_answer
  and a.user_id = b.user_id
  and a.id > b.id;
  
  

 

上一篇:C++ 关于protected


下一篇:linux安装python