MySQL的临时表不能用在复合语句中
如:
drop table if exists tmp_Table2;
create temporary table tmp_Table2 (Id int(10) not null auto_increment primary key, field1 varchar(100));
delete tmp_Table2 as A from tmp_Table2 as A, (select *, MIN(Id) from tmp_Table2 group by field1 having count(*) > 1) as B where A.field1 = B.field1 and A.Id > B.Id
tmp_Table2是临时表,上边的用法行不通。