如何编写一个delete命令来替换三个sql?

时间:2018-12-01 07:55:36

标签: mysql sql-delete

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'不存在

0 个答案:

没有答案