create table tmp(select * from process
where time in (select max(time) from process
group by class,date));
drop table process;
rename table tmp to process;
现在我想编写一个delete命令来替换上面的三个sql。
我的尝试:
delete from process
where time not in (select max(time) from process
group by class,date);
错误1093(HY000):表'process'被指定两次,都作为 “删除”的目标,并作为数据的单独来源
delete from a
where a.time not in (select max(time) from process a
group by class,date);
错误1146(42S02):表'learningProcess.a'不存在